Special Functions

Special Functions

exit([int])  [void]

Exit from a running script with a given error code (0 indicates success)

lock([object])  [void]

Lock an object as immutable permenantly, so future mutations will throw an error.

hash([object])  [int]

Returns the 64-bit unsigned integer hash corresponding to an object. hash will throw an error if the object is not hashable.

clone([object])  [object]

Will create a deep-clone of an object, if possible. The clone will be unlocked and mutation will be allowed. clone will throw an error if the object is not cloneable.

assert([bool], [string]?)  [void]

Assert a condition, with an optional message in case the condition fails.

tech_version()  ([int], [int], [int])

Returns the major, minor and patch version of technetium.

script_path()  [string]

Returns the absolute (canonicalized) path to the current running script. Throws an error if this doesn’t make sense (i.e. if the script is passed via stdin).

sleep([int or float])  [void]

Returns after waiting a given number of seconds.