[REBOL] Re: Using a Math oper. buried in a variable
From: henrikmk:gm:ail at: 2-Apr-2009 22:58
>>> op: :*
>>> op num1 num2
> == 30
>>>
>
> Cool!
>
> but I would have never fingered that out in a million years. :)
Alright, a little theory:
:* is a get-word! and when you get-word something, you get its
content. In this case, you are getting a function body, but not
evaluating it. This way, you can set words to a particular function
body, so above, 'op is set to that function body.
It's similar to saying:
get '*
Whereas evaluating it, would be equivalent to:
do '*
Try something like:
probe :for
and out pours the sourcecode for the FOR function.
--
Regards,
Henrik Mikael Kristensen