Re: [stack] Properties of Concatenative langauges and Forth
John Nowak <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
On Jan 2, 2009, at 11:50 AM, William Tanksley, Jr wrote: > Christopher Diggins <[email protected]> wrote: >> > >> f g h <=> (f g) h <=> f (g h) >> Does Forth have this property? > > Yes, except where you're using macros or other compiling words. I think macros and compiling words get a pass. Saying they don't wouldn't be much different than saying Haskell isn't purely functional because top-level definitions can alter the meaning of other parts of the program. Forth's dynamic nature obscures this a bit, but I think it's essentially the same thing. The concatenative requirement is sensibly limited to expressions within the language. In certain cases, it might be required to expand the macros to get the concatenative expression. I think we can sensibly talk about a concatenative language "plus macros". Factor offers a good example; just because there exists a macro for locals doesn't make the language non-concatenative. > It's kind of odd to say that Postscript and Forth are Joy-like. Indeed. - John