[REBOL] Re: "get" function
From: edoconnor:gm:ail at: 9-Nov-2010 11:54
> So, in a nutshell, `:blah' is identical to `get blah'?
As far as I know, yes, although the get notation is probably quicker.
if is the standard or natural form; it refers to the action of
returning any referenced value
if: is the "set form"; it refers to the action of assigning if to a value
'if is the literal form; it refers to the word/symbol, isolated from
any value it references
:if is the "get form"; it refers to the referenced value, isolated
from any word handles on the value
If you evaluate native? if, you'll run into a problem because you used
the natural form of if, which means it will trigger the dereferencing
process (which requires arguments to be supplied to the function).
You can inspect the function value referenced by if just like a
series. To do this, use the get-form (or the get function) and use a
>> first :if
== [condition then-block /else else-block]
>> second :if
>> third :if
"If condition is TRUE, evaluates the block."
/else "If not true, evaluate this block"
if is a native in R2, so there isn't much to access here. A function
like probe might be better, since it's a mezzanine. Here are some of
the guts of the simple probe function.
>> second :probe
print mold :value :value
>> first second :probe
>> second second :probe