[Grace-core] Scala vs Java
James Noble
kjx at ecs.vuw.ac.nz
Fri Aug 8 21:42:05 PDT 2014
> We have most of them in Grace and the others seem less important.
the main one we don't have being multiline strings.
which I still wonder about.
> I would move case classes to the top of the list--it's such a drag that a basic data-holder class in Java requires 10-20 lines of code per field.
so we have now e.g.
object {
def field1 is public = ...
def field2 is public = ...
}
which should define == & != but not an extract method
(or potentially)
object is pubic {
inherits grace.value
def field1 = ...
def field2 = ...
}
which might also define an extract method.
The catch in Grace is, with a strong separation of types & classes,
you'd also need to define a type if you wanted to match agains these.
Something like:
type MyStructure = {
field1 -> Unknown
field2 -> Unknown
extract -> Tuple2<Unknown, Unknown>
}
J
More information about the Grace-core
mailing list