#type obj : is
Returns the internal type of obj
. The type constants are defined in R.ObjectType
in Core.dll. To get a .Net Type, use obj:GetType
.
Basic type information:
0x00000001 | Null |
0x00000002 | Mark ([ )
|
0x00000008 | Integer |
0x00000010 | Number |
0x00000020 | Char |
0x00000040 | String |
0x00000080 | Boolean |
0x00000200 | TokenisedBlock (function block) |
0x00000400 | Array |
0x00004000 | Object |
0x00008000 | Class |
Type modifiers:
0x00000800 | Token |
0x08000000 | DeepVector (depth 2 or higher, e.g. int[][] )
|
0x20000000 | Vector |
Types defined, but never seen in code (used internally by the interpreter):
0x00000004 | EndMark |
0x00000100 | Block (blocks always tokenised immediately) |
0x00001000 | SystemToken |
0x00002000 | NewLine |
0x00010000 | Invocation (: syntax) |
0x00020000 | Comment |
0x00040000 | TokenTypeGiven (used by Rowan) |
0x10000000 | Mixed |
0x40000000 | Compiled |
0x80000000 | StringRep (has not yet been resolved) |
Any type except Array may be a vector, in which case its type is ORed with 0x20000000
(R.ObjectType.Vector
) - e.g. 0x20000008
is Vector of Integer.
You can get the value type out of the number returned by Anding with R.ObjectType.Value
, or the basic (elemental) type by Anding with R.ObjectType.ValueNoMods
.
.Net matrices (int[,]
) are converted to deep vectors (int[][]
).