Re: [stack] A question on joy syntax.
"William Tanksley, Jr" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
Rahul <[email protected]> wrote: > I have been looking through the joy papers, and have > this confusion: > 1 5 [1 =] [dup *] [dup +] ifte . > 10 > The doubt I have is this: > as soon as [1 =] is executed, I would expect '5' off the stack, > so the [dup +] should have actually found '1' on the stack and given > me 2. Yup. Me too. But that's not what Joy does; some of Joy's combinators save the stack's state when they're performing certain types of actions. You simply have to learn which ones do it and which ones don't. Sometimes this is very handy. Sometimes it's annoying. > rahul. -Billy