3 ms·
In my opinion, there are two big things that Kernel brings to the table: 1) Arguments are not automatically evaluated before being passed to the underlying "op
by bsder 5y ago
In my opinion, there are two big things that Kernel brings to the table:
1) Arguments are not automatically evaluated before being passed to the underlying "operative" in Kernel-speak. This is important because it obviates the need for the macro machinery. This is fairly similar to Tcl.
2) Environments are first-class in Kernel. This is important because you can now constrain the scope explicitly. Do I want to evaluate this in the defining context (lexical scope)? Do I want to evaluate this in the calling context (dynamic scope)? Do I want to evaluate this is global or initial scope? All of these things are possible because environments are a thing that can be passed around.
The downside is that this level of mutability seems to constrain the ability to pre-compile things.
One of the "problems" that I would consider Tcl to have is that certain "atoms" don't self-evaluate. There's really no good reason for why you have to write:
% if 1 {expr 2} else {expr 3}
instead of
% if 1 2 else 3
And no good reason why you can't write:
% + 1 2
3
instead of
% expr 1 + 2
3
This seems like going gratuitously out of the way to avoid "looking like Lisp" which was in its down phase by 1990.
- mst 5y agoNote that Tcl 8.5 added a mathop package https://www.tcl.tk/man/tcl8.5/TclCmd/mathop.html https://www.tcl.tk/man/tcl8.5/TclCmd/mathop.html which means you absolutely can write [+ 1 2] now if you import the relevant procs.