[Grace-core] Binding symbol and egality symbol

James Noble kjx at ecs.vuw.ac.nz
Fri Nov 12 14:51:36 PST 2010


> As James says, it's the binding of the name to the object that is  
> unchanging, not the object itself.  But that will not be obvious to  
> a novice.

Right. But it's an important disticntion.
I'm getting used to writing method to define methods, var for  
variables seems to make sense (although there is a question whether it  
is optional).

But I'm not sure what to call the other kinds of definitions. One  
option would be "def" bur that would make our choices the exact  
opposite of Scala - but I can see that it is consistent.
"name" seems wrong. If we keep var then this keyword needs to be no  
longer than 3 chars.

> Let is conventionally used in mathematics for this kind of binding.   
> I don't object to "const", but const will certainly require  
> explanation.  Since explanation is inevitable, I would rather  
> explain "let" than "const"

Let harks back to BASIC and isn't longer to type than var

Another option is not to have a keyword for name definitions:

Pi = 3

Or with an access specifier:

public Pi = 3


J

> On 12 Nov 2010, at 11:44, James Noble wrote:
>
>>> Incidentally, I also agree with the choice of "const" as a  
>>> keyword. When I saw the "let" I immediately wondered why that was  
>>> chosen. "const" is immediately clear and expressive, "let"  
>>> requires explanation and interpretation.
>>
>> I don't think there is a good solution here - at least not in  
>> English. The problem with "const" - or scala's "val"
>> is that, well, the object being bound to the name isn't necessarily  
>> constant (or a value)
>> const at least has the associations from Pascal.
>>
>> I'd originally hoped to follow Self - without any keywords, which  
>> is why the symbols were different.
>>
>> fixedSlot = anObject
>>
>> variableSlot <- anObject
>>
>> Hmm: perhaps "fixed"?
>>
>> James
>
> _______________________________________________
> Grace-core mailing list
> Grace-core at cecs.pdx.edu
> https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core


More information about the Grace-core mailing list