[Grace-core] Minutes of Teleconference 2011.08.17
James Noble
kjx at ecs.vuw.ac.nz
Wed Aug 17 18:19:27 PDT 2011
* don't need comprises on class declarations - just use explicit unions?
* adopt "type-like" colon patterns --- v : Foo(a,b,c)
* what are "extract methods"?
method called "extract()" -- needs covariant width subtyping on the return value
* how are they defined?
- no default extract method; programmers must write them
(Good example for an eventual on extractors blog post:
point / colourpoint; rectangle extract two points / colourrectange extract two colourpoints)
* method generic parameters declared & (optionally passed) after method names
* method m[T](a : T) : R where T <: U ; x.m(t) x.m[U](u)
* class generic parameters
* class A[T] where T <: Comparable[T] { a, b ->
* type generic parameters
* type Rat[X,T] = {m()} | {n()}
** do we need type where clauses?? Kim thinks not. if we do they go here: type Rat[X,Y] where X <: T = ...
* annotations on methods & classes go (with/after) where clauses
* next meeting: 23aug for me, 24aug for you
TODO:
* Kim to draft blog post:: How to deal with these collection types
* James to blog about lancanster (hint about SPLOOPSLA)
* James (& Michael) to work out types & protocols for pattern matching (interface of class Pattern)
* J / M eventually blog about that when it's done
Questions:
* type generic methods - can they pick up actual generic parameters...
- what if called on type dynamic, do they pick 'em up from the type or the calling context
perhaps this is a non-issue; can pick up types off objects via match statements?
** issue of creating instances of generic types still unresolved!
- Factory.new[Types](args) --- this is the "normal" generic method send syntax
and those types will hopefully be picked up via type inference
- Factory[Types].new(args) --- is more java/scala like, perhaps is more consistent
with the use of the thing (which will be Type[Types] or whatever)
but we don't have any semantics for expressions of type Factory[Types]
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Some discussions about collections (for Kim's blog)
seq(1,2,3,4) - actually private self message
types Seq.new(1,2,3,4)
s.at(3)
s @ 3
s.put(3,"foo")
vs
s[2]
s[3] := 4
def ai = array(1,2,3,4)
vs
def ai = ArrayClass.new[Integer](1,2,3,4)
what is the name of the type? of the class?
Array - must the shortest name be the "type"
ArrayClass
ArrayFactory
How to create instances of generic classes:
Array[Integer].new --- what does this mean in Graceland?
or Array.new[Integer] --- at least this we understand?
====
More information about the Grace-core
mailing list