Runtime Type Information (RTTI)
No matter if your language is statically or dynamically typed, you can always access RTTI in Neko. RTTI is powerful because you can decide which behavior to adopt depending on some value at runtime. The most common application of this is to print some debugging information. Another one is introspection : the ability to look inside an object, read its fields, and call its methods.
$typeof returns an integer specifying the type of a value according to the following table :
$typeof(3); // 1 $typeof($array(1,2)); // 6 $typeof(null) == $tnull; // true