Re: [stack] Classifying languages by how they handle operands

Don Groves <[email protected]>
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
On Jan 22, 2008, at 19:14 , William Tanksley, Jr wrote:

> Don Groves <[email protected]> wrote:
>> It occurred to me recently that one way to differentiate programming
>> languages is by how they handle operands.
>
> Sure thing -- sensible.
>
>> Lisp and its cousins use operands only once, placing them in a
>> structure preceded by an operator, (+ a b c) , effectively combining
>> their passing and evaluation.
>
> Let me add a word to your description:
> Lisp and its cousins place operands them in a *lexical* structure
> preceded by an operator, (+ a b c) , effectively combining their
> passing and evaluation.
>
> I also deleted "use operands only once", since I don't know what you
> mean by that. (What did you mean?)

Mea culpa, William, I should have said something like, "use operands in
only one form."

Many languages use operands in two distinct forms, one for evaluation,
x = a+b, and another for passing, DoSomethingWith(a,b). To me, the
combining of these into a single form is one of the beauties of Joy,
Lisp, etc.


>> The languages of interest to this group place operands in a structure
>> followed by a sequence of operators, (a b c) + +, which also combines
>> passing and evaluation.
>
> ...and here my modification is to stress that the structure is a  
> *semantic* one.
>
> The major difference is that the lexical structure is constrained to
> the medium of the language -- one-dimensional text parsed into a tree.
> A semantic structure can be more complex -- the operand flow for a
> stack language is a digraph rather than a tree.
>
> There are pros and cons to both.
>
>> While admittedly low level, is this concept worthy of further
>> discussion? Has it been discussed before, either here or elsewhere?
>
> I believe Manfred looked at it before... I can't recall which  
> paper, though.

Thanks, I'll look for it. And you make an excellent point about the  
lexical
vs. semantic structure.
--
Don


>> Don
>
> -Wm
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.