[Grace-core] Minutes of Teleconference 2012.01.10-11
Kim Bruce
kim at cs.pomona.edu
Wed Jan 11 11:54:07 PST 2012
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