xraid (sorry, I don’t know your real name) tried to clean up
examples/fields.duby by having the constructor assign a new ArrayList.
However the existing syntax was my attempt to do a type declaration +
assignment to null, which unfortunately no longer appears to work.
The problem is that since we don’t have a specific field declaration
syntax (Ruby doesn’t have one) we just declare fields to be whatever
type we first assign to them. That’s not ideal; it means @a =
ArrayList.new will be of type ArrayList rather than List or
Collection, and declaring the field requires something like I had in
fields.duby: @a = ArrayList (with no .new).
So perhaps we should discuss how field declaration should work. Unlike
Ruby, we need to have all fields declared at compile time, so we need
@a = ArrayList (the “a” field will be declared as type ArrayList
and assigned null)
@a = ArrayList
ArrayList @a # ick, Java style
None of these are particularly hard to compile.
To unsubscribe from this list, please visit: