2019-06-02

Functional Programming

Functional Programming (Tcler's Wiki)


Tcl 是個很奇妙的語言,就如同下面說的:

As with many things, Tcl is rather unique in this area. Commands themselves can not be passed as arguments to other commands, but their names can, which provides something very similar to first-class functions. Additionally, apply can be used to interpret a value as a function and evaluate it, providing the equivalent of lambda functions.


Tcl 的表達方式與波蘭表示法 (Polish notation) 一樣,和 Lisp 的 S-expression 的精神十分相像,特點是操作符置於操作數的前面(就是如果是一連串資料所組合成的述句,Tcl 述句的第一個是一個 command,後面是 command 要處理的資料)。

Tcl 也跟 Lisp 一樣,並不是純粹的 Functional Language,而是支援多重典範的語言。

沒有留言: