What follows is a list of builtins always provided by the permissions system, along with a description of their behaviour.
next(bool)
- This is described in Usage.cast(Type, value)
- Casts a value to the specified type, and returns the casted value.
Casts the value given by the expression in the second argument to the type described in the first. The type may be described in one of 3 ways:
- It can be one of the type keywords (
object
,string
,int
, etc.), - If it is a core lib type (defined in System.Private.CoreLib, or the equivalent) and not generic, it may
be specified as the type name with no special adornments (
System.String
, etc.) - Otherwise, it must be specified with a string that would resolve the type when passed to
Type.GetType(string)
.
For example, if you wanted to cast a value to a double
, you could write cast(double, value)
, and if you
wanted to cast a value to System.Type
, you would write cast(System.Type, value)
, but if you wanted to cast
to some custom type, like HivePlugin.PermissionContext
(in assembly HivePlugin
), you would have to write
cast("HivePlugin.PermissionContext, HivePlugin", value)
. Casting behaviour is mostly the same as in C#, but
it also follows conversion chains (through implicit and explicit conversions) to get to the target.