Skip to content
Christopher Ross-Gill edited this page Aug 1, 2016 · 1 revision

To get the source code for a mezzanine-level or user-defined function, you can use the SOURCE function.

For example:

source probe

will display

probe: make function! [[
    {Debug print a molded value and returns that same value.}
    value [any-type!]
][
    print mold :value
    :value
]]

Another example, to see the source for the SOURCE function:

source source

displays:

source: make function! [[
    "Prints the source code for a word."
    'word [word! path!]
][
    if not value? word [print [word "undefined"] exit]
    print head insert mold get word reduce [word ": "]
    exit
]]
Clone this wiki locally