Rowan home > Reference > #type

#Type: Object Type

Module: Main
Syntax: #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:
0x00000001Null
0x00000002Mark ([)
0x00000008Integer
0x00000010Number
0x00000020Char
0x00000040String
0x00000080Boolean
0x00000200TokenisedBlock (function block)
0x00000400Array
0x00004000Object
0x00008000Class

Type modifiers:
0x00000800Token
0x08000000DeepVector (depth 2 or higher, e.g. int[][])
0x20000000Vector

Types defined, but never seen in code (used internally by the interpreter):
0x00000004EndMark
0x00000100Block (blocks always tokenised immediately)
0x00001000SystemToken
0x00002000NewLine
0x00010000Invocation (: syntax)
0x00020000Comment
0x00040000TokenTypeGiven (used by Rowan)
0x10000000Mixed
0x40000000Compiled
0x80000000StringRep (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[][]).