Planet JFX


118pages on
this wiki
Add New Page
Add New Page Talk0

Sequences Edit

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


(immutable arrays)
Singleton is a sequence of length one
Singleton can be automatically coerced to array
Cardinality orthogonal to type
Cardinality part of type
Is NOT an Object
IS an Object
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
Flat by definition
Need concatenation and/or flattening operator

Familiarity (e.g., javascript, Java)

Java interoperability
Can nest

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)
Object methods (e.g., hashcode) on array is array operation or Object operation?

No consensus. No strong opinions.

Back to JavaFX Compiler

Comments Edit

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?

Also on Fandom

Random Wiki