castAlters the data-type of the previous function without altering its output
cast alters the data-type annotation for a pipe.
The contents of the pipeline are preserved, only the reported data-type is changed.
Additionally cast can be used to define the output type
of a function.
Changing type annotation for a pipe
<stdin> -> cast data-type -> <stdout>
<stdin> :data-type: command
Defining the output type of a function
cast data-type
» out {"Array":[1,2,3],"Map":{"String": "Foobar","Number":123.456}} \
-> cast json
{"Array":[1,2,3],"Map":{"String": "Foobar","Number":123.456}}
» out {"Array":[1,2,3],"Map":{"String": "Foobar","Number":123.456}} \
-> :json: cat
{"Array":[1,2,3],"Map":{"String": "Foobar","Number":123.456}}
» function example {
cast json
out '{"foo": "bar"}'
}
» example -> debug -> [[ /Data-Type/Murex ]]
json
Please note you’d normally use the Object Builder to create JSON objects.
If you want to reformat the stdin into the new data type then use
format instead.
out: Print a string to the stdout with a trailing new
line charactertout: Print a string to the stdout and set it’s
data-typeformat: Reformat one data-type into another
data-type%{} Object
Builder: Quickly generate objects (dictionaries / maps)This document was generated from builtins/core/typemgmt/types_doc.yaml.
This site's content is rebuilt automatically from murex's source code after each merge to the master branch. Downloadable murex binaries are also built with the website.
Last built on Tue Nov 10 18:11:59 UTC 2026 against commit 7547c407547c4045d7ae61ca6f41f9080b9469f4eceb252.
Current version is 7.4.2002 (unknown) which has been verified against tests cases.