Re: [stack] map fusion
"William Tanksley, Jr" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
John Nowak <[email protected]> wrote: > Unfortunately, this is not valid because 'F' and 'G' can access more > than one value on the stack. Here is a counterexample to the above rule: Okay, I think I get this. (I certainly agree.) > This seems to be yet another argument against n-ary combinators where > the quotation is not called a fixed number of times. _This_ I don't understand. What does that mean? I would have said "this is an argument against combinators which repeatedly call function inputs that do not have a statically known stack effect." Am I being too restrictive? Are you being too restrictive? > It seems the solution is to offer two versions of certain combinators. > The restricted versions ('map, 'each', etc) will be easier to reason > about and optimize, while the unrestricted versions ('map*', 'each*', > etc) will remain useful in a way only possible in stack-based > languages. I think this would be worthwhile to adopt in both typed and > untyped languages. I definitely like this; although of course in Factor the asterisk prefix is already taken. > - John -Wm