[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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.