[Grace-core] Minutes of Teleconference 2012.01.10-11

Andrew P. Black black at cs.pdx.edu
Wed Jan 11 13:00:49 PST 2012


Funny ...

Having looked at James'e email, I was going to say that I now realize why the news have to be there, and I'm happy with the existing syntax.

I could live with moving the superclass clause outside the braces, but would like to see it connected to the brace expression with an operation, because I want to see think about class expressions, not class declarations, so I want class-valued denotations.  In fact, now that classes don't magically create types, I think that we should go back to using def for class decls.

	def myclass = class { ... }

Not sure how this works with the parameterized stuff, though.

So 
	<parentObject> subobject { new stuff }

or
	{ new stuff } extends <parentObject>

work for me, but not what Kim is suggesting, because it doesn't give me a way of writing a class expression.

The second new in Kim's example is not redundant, because the class has to inherit from and object, and the object that it inherits from is NOT StackClass, but StackClass.new(bottom), or maybe color.blue, or whatever.

To summarize: the syntax should follow the semantics, and not be something arbitrary because we like or dislike some existing language.  


On 11 Jan 2012, at 11:54 , Kim Bruce wrote:

> I'm rethinking my position on the syntax for class constructs.  The current proposal is 
> 
> class CountingStackClass.new<T>(size : Number, bottom : Number) -> CountingStack<T> {
> inherits StackClass.new<T>(bottom) 
>     // permitted via "definitively static" 
> var count:= 0;
> override method push ...
> ...
> 
> I'd rather see 
> 
> class CountingStackClass<T>(size : Number, bottom : Number) -> CountingStack<T>
> inherits StackClass<T>(bottom) {
>     // permitted via "definitively static"
> var count:= 0;
> override method push ...
> }
> 
> Advantages:
> 1.  Threw away two noisy occurrences of “.new”.
> 2.   Putting “inherits StackClass” outside of  curly brackets is more similar to type constructions:
>             type ExtType = SomeType & {m(T) -> U, …}
> 3.   Resulting syntax is closer to existing languages (but we would still use CountingStackClass.new<T>(args) to call the constructor and the translation to objects would be exactly the same).
> 
> James called a minor variant of this "encoding classes as methods" (with a different encoding), but I don't see the need for that.
> 
> Kim
> 
> 



More information about the Grace-core mailing list