You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BODY-OF is defined for all values of type any-function!. In the case of command! values, it yields the same as the get-word. It should, in my opinion, give the actual value of the body as stored in the machine, which is a block containing the extension module in which the command was defined, and the command-index (ordinal of the command, 0-origin).
>> probe body-of :deref
make command! [["Get 32 bits value pointed at" v]]
>> probe :deref
make command! [["Get 32 bits value pointed at" v]]
BODY-OF has no meaning for native functions and should return NONE. Note that commands can also be user-defined functions (to allow interpretation within DELECT command dialects such as remote services, etc.) and in that case should return the same result as a function!.
Retrieval of information such as extension module or index is not the same as body, and if needed, can be returned by some other reflector option.
Rebolbot commented on Apr 26, 2010:
Submitted by:meijeru
I do not agree with your last statement (that a different reflector is needed). The extension module (which contains the RIX pointer) and the command-index, are the nearest you will have to a body. Also, for actions, a number is returned by body-of; or are you proposing to do away with that also?
Rebolbot commented on Apr 26, 2010:
Submitted by:BrianH
Those index numbers aren't the closest thing actions and commands have to a body - that would be the native code, and we don't want to return that. The index numbers are something else, so another reflector would probably be appropriate.
Submitted by: meijeru
BODY-OF is defined for all values of type any-function!. In the case of command! values, it yields the same as the get-word. It should, in my opinion, give the actual value of the body as stored in the machine, which is a block containing the extension module in which the command was defined, and the command-index (ordinal of the command, 0-origin).
Imported from: CureCode [ Version: alpha 97 Type: Bug Platform: All Category: Datatype Reproduce: Always Fixed-in:alpha 98 ]
Imported from: metaeducation#1578
Comments:
Submitted by: Carl
BODY-OF has no meaning for native functions and should return NONE. Note that commands can also be user-defined functions (to allow interpretation within DELECT command dialects such as remote services, etc.) and in that case should return the same result as a function!.
Retrieval of information such as extension module or index is not the same as body, and if needed, can be returned by some other reflector option.
Submitted by: meijeru
I do not agree with your last statement (that a different reflector is needed). The extension module (which contains the RIX pointer) and the command-index, are the nearest you will have to a body. Also, for actions, a number is returned by body-of; or are you proposing to do away with that also?
Submitted by: BrianH
Those index numbers aren't the closest thing actions and commands have to a body - that would be the native code, and we don't want to return that. The index numbers are something else, so another reflector would probably be appropriate.
The text was updated successfully, but these errors were encountered: