Re: [stack] Re: Joy noob checking in!
Chris Double <[email protected]> Tue, 11 May 2010 12:21:14 +1200
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
On 11/05/10 11:34, John Cowan wrote:
> In Joy, lists and closures (not that there's anything
> to close over) are the same thing, so you can create functions
> using list manipulation and then execute them. As far as I know,
> this isn't possible in Cat or Factor.
Factor has functions for manipulating 'quotations' and converting
sequences of words to quotations. For example:
{ "Hello" print } >quotation call
In this example { ... } is a sequence containing the string "Hello" and
the word (Factor's terminology for function) 'print'.
>quotation converts this to a quotation (Factor's terminology for an
anonymous function) and then calls it.
You can also curry quotations, compose them, etc:
"Hello " [ print ] curry call
[ "Hello " ] [ print ] compose call
Chris.
--
http://www.bluishcoder.co.nz