Re: [stack] function/object ambiguity + quotation alternative
John Cowan <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
John Nowak scripsit: > In a concatenative language, all terms denote functions. I don't think > this is too contentious to say. For example, '42' denotes the function > that pushes the value 42 onto a stack. '[foo bar]' is a function that > pushes the quotation/list [foo bar] onto the stack. Et cetera. For Joy, at least, you can go further: *everything* is simultaneously a value and a function. Thus '+' is both a value (a symbol, specifically) and the addition function. The difference between symbols as values and all other values is that they do something as functions other than "push self on stack". So you can't just say its name to get the 'first' symbol on the stack; instead, you must use a circumlocution such as '"first" intern' or '[first] first' instead. Furthermore, by what I consider a bug in Joy, second-order functions will only handle lists of symbols rather than single symbols, so you cannot say "[1 2 3] "first" intern i" to get 1 on the stack. -- John Cowan http://ccil.org/~cowan [email protected] Mr. Henry James writes fiction as if it were a painful duty. --Oscar Wilde