[Grace-core] Modules & Inheritance

James Noble kjx at ecs.vuw.ac.nz
Wed Oct 17 14:17:25 PDT 2012


Hi all

[for those of you on grace-core, you're probably lacking some context.
The discussion started about language levels, but has .... widened somewhat. 
Since it's interesting, I'm trying to move it to grace-core & stop manually cc:ing people]

>> Also where does the "dialect" come from? 
>> How are names like "if" resolved?
> 
> 	That's the same question, I think.   We have been seduced by the ability to introduce what are effectively global names by making receiver-less requests go up the lexical hierarchy of objects.    

well sure - that's what nesting does.  Although they're not properly global names:
they're names defined outside the module: precisely where they are defined is what
I'm trying to tie down.

>> A separate one-level mechanism? Something else?
> 
> 	A separate mechanism.  It would need to be multilevel, so that a "statement" (like if) introduced by a dialect would be available though any number of nested scopes.   Such a mechanism might be like procedures with lexical scopes, which,

How is this different from the nesting we get with nested objects? 
If objects can be part of that nesting, then it seems the same as what we have:
if object's can't be - then do we have object nesting, or do we only have top-level objects?

I think the _topology_ is mostly independent of the question of whether we have a syntax for "implicit requests"
or the semantics of those or any other kind of request. 

> incidentally, would also give us (the effect of) private methods.

we don't have "private methods" in the Pascal sense, because we don't allow methods to be nested inside methods.
We could. That wouldn't give object-private methods though - or if it does, I don't see how. 


>> again - because as well as being explicit, we want good code to look better
>> than not so good code.
> 
> I think that you are confusing "looking good" with "being concise".  

generally in programming, smaller and more concise is better than long or more wordy.
certainly "good code shorter than bad code" was one of our principles.

another (famously) was "no implicits" - so perhaps we should get rid of "implicit requests" purely on that principle... 

>  I've been using Smalltalk for 19 years now, and I think that Smalltalk code looks good.  self in Smalltalk is always explicit.

Right - but I spent N years using self, where self is almost always implicit, 
and while I think Smalltalk code looks good, I think Self code looks better :-)

of course I'm hoping Grace code will look better still: 
but I'm aware that is as much about me (or us) developing an aesthetic than anything

>   I'be been trying to read Java for 18 years, and all of the implicit magic (implicit this, open imports, for syntax, exception handling) that has been introduced to try and make Java programs shorter just makes them unreadable — to me.

:-)

J


More information about the Grace-core mailing list