Types & safe values · BUILT-IN MODULE
typing
Runtime type inspection helpers.
Quick start
use typing
value = 42
say typing.type_of value
say typing.is value "Int"
say typing.cast value "Int"API reference
typing.type_of valueReturn the runtime SE type name.
回傳 runtime 中的 SE 型別名稱。
typing.is value type_nameCheck the runtime type name.
檢查 runtime 型別名稱。
typing.cast value type_nameAssert a runtime type and return the value.
確認 runtime 型別後回傳原值。