Rebol Programming/reflect

USAGE:Edit

REFLECT value field 

DESCRIPTION:Edit

Returns definition-related details about a value.

REFLECT is a function value.

ARGUMENTSEdit

  • value -- (Type: any-type)
  • field -- Such as: spec body words values title etc. (Type: word)

(SPECIAL ATTRIBUTES)Edit

  • catch

SOURCE CODEEdit

reflect: func [
    "Returns definition-related details about a value." 
    [catch] 
    value [any-type!] 
    field [word!] "Such as: spec body words values title etc."
][throw-on-error [
        switch/default field [
            spec [spec-of :value] 
            body [body-of :value] 
            words [words-of :value] 
            values [values-of :value] 
            types [types-of :value] 
            title [title-of :value]
        ] [
            cause-error 'script 'invalid-arg field
        ]
    ]]