Sequences[]
The pros and cons of sequences (as in the JavaFX interpreter now) vs
immutable arrays were discussed:
Everything is a sequence (as in the JavaFX interpreter now) |
Arrays are different from
singletons |
|
Singleton |
Singleton is a sequence of length one |
Singleton can be automatically coerced to array |
Type |
Cardinality orthogonal to type |
Cardinality part of type |
Object |
Is NOT an Object |
IS an Object |
null |
Is an empty sequence |
Is an Object value ([] is empty array) |
Down conversion to singleton |
Automatic: last element |
Explicit: first, last, only if singleton, etc |
Nesting allowed |
No nesting -- always flat |
Nestable |
Flattening |
Flat by definition |
Need concatenation and/or flattening operator |
Pros |
Familiarity (e.g., javascript, Java) Java interoperability |
|
Cons |
Automatic down conversion is counterintuitive Gilad: "The fact that arrays are not objects is terrible" |
Need explicit operator to flatten Different than other Objects -- immutable (copy on assign) |
No consensus. No strong opinions.
Back to JavaFX Compiler
Comments[]
It seems to me that the current situation is pretty good. You get the helpful flattening behavior by using arrays, and if you want to do nesting you just put objects in the arrays, and use a property. That seems like the best of both worlds, in this programming domain. Users mostly see things that are flattened, not nested, so a UI language needs to be pretty good at flattening in general. Rossjudson 21:44, 1 March 2008 (UTC)
What is the meaning of flattened?