[E-Lang] Syntax Reductions: Consensus so far
Mark S. Miller
markm@caplet.com
Mon, 05 Mar 2001 15:07:38 -0800
At 03:54 AM Monday 3/5/01, Tyler Close wrote:
>Just to throw another log on the fire, what do you think of changing:
>
> def add(a, b) :any {
> a + b
> }
>
>to:
>
> to add(a, b) :any {
> a + b
> }
This fatally conflicts with other design goals. When defining a function, the
name is simply a variable name, as is familiar from Scheme. When defining a
method, the name is a message name to be looked up in a whole 'nother name
space -- the vTable of the receiving object. The current syntax already has
some danger of suggesting that these two are more similar than they are.
The above suggestion makes this possible confusion a certainty.
I chose the name "to" to suggest that one should usually chose verbs for
message names. Similarly, one should usually chose nouns for variable
names. Variable names are used to designate objects (including functions).
Message names are used to ask these objects to do something. The function
syntax can be seen as a way to ask an object to "do your thing", whatever
that may be, which therefore doesn't need to be named.
At 07:48 AM Monday 3/5/01, zooko@zooko.com wrote:
>P.S. but I'm tainted by LOGO... ;-)
I indeed got "to" from Logo, where it's also supposed to be followed by a
verb. Logo didn't have objects at the time, so the above conflict didn't
arrive.
Cheers,
--MarkM