|
Re: [XPAND] Casting possibilities [message #776528 is a reply to message #776520] |
Sun, 08 January 2012 17:27 |
|
Hi,
(from the docs)
Casting
The expression language is statically type checked. Although there are many concepts that help the programmer to have really good static type information, sometimes. One knows more about the real type than the system. To explicitly give the system such an information casts are available. Casts are 100% static, so you do not need them, if you never statically typecheck your expressions!
The syntax for casts is very Java-like:
((String)unTypedList.get(0)).toUpperCase()
// results to true, if the result of someExpression is of type MyType or its subtypes
MyType.isInstance(someExpression)
// results to true, if the result of someExpression is exactly of type MyType
someExpression.metaType == MyType
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04864 seconds