Re: [stack] stackless concatenativity + visual dataflow
John Nowak <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
On May 20, 2008, at 7:52 AM, Chris Double wrote:
> Based on the things I've written in Factor a 'fixed arity' restriction
> would have little to no effect on what I've written.
Very good to hear! I was half-expecting it to be shot down for being
overly restrictive.
> It did in the past when 'curry' was discouraged and quotations passed
> to 'map' and the like would often access items deeper in the stack...
>
> 5 { 1 2 3 } [ over + ] map
> 5 { 1 2 3 } [ + ] map-with
The version using map-with is certainly clearer. Perhaps there really
is a readability benefit in gently forcing the programmer to use
combinators with fixed stack effects.
> Would your restriction still allow curry, compose, etc?
Yes, and you wouldn't need different versions of 'compose' for each
possible arity combination of the functions being composed. In other
words, '[0] [+] compose' and '[swap] [over] compose' would both be
fine, even though the arities of the input quotations and the arities
of the resulting composed quotations do not match at all.
- John