Re: [stack] Syntax for combinators
"William Tanksley, Jr" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
Manfred Von Thun <[email protected]> wrote: > Question: which level is best? Safety bought by inflexible rigidity, or > flexibility at the cost of obfuscation? I¹ll leave it at that. Pick your > level and tell us about it. I think one of the great advances of Joy over Forth was its ability to pass code to combinators. Going back to a fixed syntax would be a pity. Safety can be acquired at less cost by adding some typechecking. However, some of Joy's combinators might be a little overdone. 'ifte' takes 3 quotations; that's a lot. I'd like to be able to express 'else' without having to go so deep on the stack. What if the 'if' combinator left a conditional token on the stack, to be picked up by an 'else' combinator? [if-part] [conditional] if [else-part] else alternately, if you really like traditional syntax, [conditional] if [if-part] else [else-part] endif The same implementation would work for more complex conditionals: [action-choice] decisiontable [decision-part] decision [decision-part] decision [decision-part] decision ... endtable An 'if' would build a two-choice decision table. A full decision table could have any number of choices. > - Manfred -Billy