Thank you! i would also like to ask about Literals used by fantom...it is stated there that: "The three types Bool, Int, and Float are value-types. These types are not necessarily passed as object references, but rather passed by value on the call stack. When value types are coerced to/from reference types like Obj and Num, the compiler will generate boxing/unboxing operations."
What do you mean boxing/unboxing operations in that statement?
It is the name given in Java for the the process of converting between the primitive values and their wrapper objects, for example int and Integer. It's a nuisance and a leaky abstraction which throws an NPE if you get it wrong.
In Fantom everything is an Object, so the whole boxing / unboxing thing is a non-issue.
Though behind the scenes for speed optimisations, Fantom does use both primitive values and wrapper objects. Generally, wrapper objects are used for nullable types like Int?, and primitives for non-nullable types such as Int.
Maru-chanTue 14 Feb 2017
Thank you so much... here's another question about the operators... in your list
SlimerDude Sun 12 Feb 2017
Moving a question to a new topic.
It's talking about Java boxing / unboxing, see:
It is the name given in Java for the the process of converting between the primitive values and their wrapper objects, for example
int
andInteger
. It's a nuisance and a leaky abstraction which throws an NPE if you get it wrong.In Fantom everything is an Object, so the whole boxing / unboxing thing is a non-issue.
Though behind the scenes for speed optimisations, Fantom does use both primitive values and wrapper objects. Generally, wrapper objects are used for nullable types like
Int?
, and primitives for non-nullable types such asInt
.Maru-chan Tue 14 Feb 2017
Thank you so much... here's another question about the operators... in your list
Primary: (x) x.y x.y() x->y() x?.y x?.y() x?->y() x[y]
How do we use these primary operations?
SlimerDude Tue 14 Feb 2017
This is a new question, and should really be in its own topic, but...
What specifically did you want to know about them?