Re: [stack] function/object ambiguity + quotation alternative
Stevan Apter <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
----- Original Message ----- From: "John Nowak" <[email protected]> To: <[email protected]> Sent: Friday, February 27, 2009 7:03 PM Subject: Re: [stack] function/object ambiguity + quotation alternative > > On Feb 27, 2009, at 6:00 PM, Stevan Apter wrote: > >> everything on the stack is a noun, everything on the queue is a verb. >> so we can rewrite your reduction, without ambiguity, as stack | queue: >> >> | 2 [dup] first >> 2 | [dup] first >> 2 [dup] | first >> 2 dup | > > Indeed you can. Or you can rewrite it without ambiguity using an > explicit stack. > > The trouble is that both approaches make it impossible to reduce in an > arbitrary order and at arbitrary levels. For example, I'd like to be > able to do the following: > > 1 2 3 + [[dup] first] [swap] first 5 2 + > 1 2 3 + [`dup] [swap] first 5 2 + > 1 2 3 + [`dup] [swap] first 7 > 1 2 3 + [`dup] `swap 7 > 1 5 [`dup] `swap 7 > > This is not possible if you use an explicit stack/queue for your > reduction. You need to make sure each step in the reduction is itself > a valid program. sure. but `dup is just notation. it's a method of recording that dup has changed its role in the reduction. > > - John >