Re: [stack] A small example of a (possibly concatenative) language for primitive recursive functions of one variable.
"William Tanksley, Jr" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
Michael Nedzelsky <[email protected]> wrote: > A small example of a (possibly concatenative) language for primitive recursive > functions of one variable. > We can define the following language: > Terminal symbols: a, b, [, ], +, (, ) > Production rules: > S --> e | a | b | S S | [ S ] | (S + S) By the basic syntactic definition we looked at before, this wouldn't be concatenative -- its (S+S) form fails. (By the way, this suggests a different wording of the definition that might pass the test. We originally stated that there may be no other grammatical rules; we could instead state that "S may not appear in the RHS of any other rules," and of course we would have to allow some other nonterminals. I'm going to stop here, but we need to figure more out.) > Let L denotes the language which generated by this grammar. > M maps L onto the set of all primitive recursive functions of one variable. Okay, makes sense. > In the article www.latrobe.edu.au/philosophy/phimvt/joy/faq.html > we can read the following. > -------------------------------- > A language in which the concatenation of programs denote the composition of > functions has been called a concatenative language. > -------------------------------- > It seems according to this sentence language L is a concatenative language. > Are you agree? Yes. But I don't think this sentence stands alone. It's like saying "A language in which the lambda form is used to define functions, which can be passed to other functions, is called a functional language." That may be true, but there are other requirements on a functional language, such as referential transparency. In the case of your language, the (S+S) form means that programs cannot be built solely by concatenating simple forms (flat concatenative) nor by passing programs to other programs (non-flat concatenative). > Michael Nedzelsky -Billy