body-of

Discussion in 'Rebol' started by MaxV, Jun 20, 2012.

  1. MaxV

    MaxV Member

    What does body-of command?
    Code:
    >> ? body-of
    USAGE:
        BODY-OF value
     
    DESCRIPTION:
        Returns a copy of the body of a function or object.
        BODY-OF is a function value.
     
    ARGUMENTS:
        value -- (Type: any)
    Then I try:
    Code:
    >> a: func [temp] [print temp]
    == [print temp]
    >> body-of a
    ** Script Error: Cannot use reflect on block value
    ** Near: make error! reduce [err-type err-id pick args 1 pick args 2 pick args
     3]
    >> body-of 'a
    ** Script Error: Cannot use reflect on word value
    ** Near: make error! reduce [err-type err-id pick args 1 pick args 2 pick args
     3]
    
    What is a body of a function?
    It seems to work just with object to me.
  2. Graham

    Graham Developer Staff Member

    Code:
    >> temp: func [ t ] [ print t ]
    >> body-of :temp
    == [print t]
    

Share This Page