Re: [stack] function/object ambiguity + quotation alternative
Stevan Apter <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
in f, which is modelled on the 'false' language, i distinguish primitives like + and defined words like 'dup'. dup is defined as the shuffle 'a-aa, where ' is syntactic quotation. a primitive executes immediately, a defined word pushes its definition onto the stack. ! (i) moves the top of the stack to the head of the queue. so e.g. we have G>dup 'a-aa G>2 'a-aa 2 G>swap 'a-aa 2 'ab-ba G>! 2 'a-aa G>! 2 2 G> and G>[dup swap]first [dup swap] [uncons ! pop !] G>! dup G>! 'a-aa G> a primitive is identical to its definition: G>2 3 [+]first! 2 3 + G>! 5 G> www.nsl.com/k/f/f.htm ----- Original Message ----- From: "John Nowak" <[email protected]> To: <[email protected]> Sent: Friday, February 27, 2009 7:36 AM Subject: Re: [stack] function/object ambiguity + quotation alternative > > On Feb 27, 2009, at 12:05 AM, John Cowan wrote: > >> 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. > > I don't consider this a bug. The rule for 'i' is as follows: > > [F] i -> F > > Changing 'i' to also operate on symbols would complicate things. > Perhaps it's a tradeoff. > > - John > >