Looks like Tcl'ers are seeing the light with prefix maths:
,----[ http://www.tcl.tk/cgi-bin/tct/tip/174.html ]
|
| This TIP describes a proposal for math operators in Tcl as seperate
| commands, acting much like the equivalent in the Lisp language. This
| would make simple usage of mathematics much clearer and could possibly
| facilitate a clean path for future [expr] extendibility.
`----
Yay!
Jesper Harder <······@myrealbox.com> writes:
> Looks like Tcl'ers are seeing the light with prefix maths:
The "TIP" does not propose anything like CL's nullary (+) and (*).
I suppose those are most useful when either the operator or the
length of the sequence varies at run time, which requires APPLY
in CL; does Tcl have that?
Kalle Olavi Niemitalo <···@iki.fi> writes:
> The "TIP" does not propose anything like CL's nullary (+) and (*).
> I suppose those are most useful when either the operator or the
> length of the sequence varies at run time, which requires APPLY in
> CL; does Tcl have that?
No, not directly. But is has EVAL, so you could cons the operator to
the front of a list and eval the result:
(apply '+ a) == eval [concat + $a]
Jesper Harder <······@myrealbox.com> writes:
> Looks like Tcl'ers are seeing the light with prefix maths:
>
> ,----[ http://www.tcl.tk/cgi-bin/tct/tip/174.html ]
> |
> | This TIP describes a proposal for math operators in Tcl as seperate
> | commands, acting much like the equivalent in the Lisp language. This
> | would make simple usage of mathematics much clearer
[snip]
> `----
Clearer, eh? What's that about the readability of M-exprs, again?
Interesting quote. :)
--
Rahul Jain
·····@nyct.net
Professional Software Developer, Amateur Quantum Mechanicist