Re: [stack] Joy's relationship to FP + a Joy variant with combining forms
"William Tanksley, Jr" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
John Nowak <[email protected]> wrote: > In short, Joy is higher order and based on composition, and FP is > first order and based on application. What I'm wondering is what a > first order language based on composition would look like. > One thing to note is that a combining form for quotation is no longer > needed since it is impossible to create objects that represent > functions. Hmm. So is Forth a first-order language based on composition? Seems that way. Mind you, Forth wasn't designed with that in mind, so its syntax is a hodge-podge, but it does seem like its semantics are comparable. I'm tempted to muck about with defining a suite of words in Forth that would give it the syntax you describe. Maybe after I get my current project into releasable form. > While FP does not allow the definition of new combining forms, such a > facility is undoubtedly necessary for real programming. The syntax for > this mimics use. Note that all variables are in uppercase so as to not > clash with function names. Here is an example of how we can define a > 'reverse-map' combining form in terms of the 'fold' combining form: > Combining form version: > reverse-map(F) = null fold(F cons) I'm thinking that this works using pure textual replacement. Is this right? If so, this is a perfect match for Forth (and more regular than the current Forth conventions). In short, I this looks like a nice model to give a concatenative stack language disciplined access to its own source code. > - John -Wm