[stack] Applicative Syntax == Concatenative Syntax
"Christopher Diggins" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
Consider if we were to define our stack-based (concatenative)
functions as quotations such as:
define Add { [+] }
We can define the open paranthesis, close paranthesis, and comma as follows:
define ( { }
define , { curry }
define ) { curry eval }
This allows us to write:
Add(2, 3)
Which leaves the value 5 on the stack just as we would like to see.
I've implemented this in the most recent version of Cat (which I have
posted at http://www.cat-language.com/cat.zip , but haven't officially
announced yet).
--
http://www.cdiggins.com