[REBOL] Re: Why I don't need get-word here!
From: g:santilli:tiscalinet:it at: 3-Nov-2003 10:06
Hi Patrick,
On Sunday, November 2, 2003, 6:58:39 PM, you wrote:
PP> So my questions are:
PP> - Do I need the get-word?
No, you don't in this case.
PP> - Is there a difference in the result?
It's the same, there's no difference.
PP> two syntaxes, the same results, what am I missing ?
Basically,
:word
always yields the same result as
get 'word
while
word
does not always yield the same result as using GET. In the recent
versions of REBOL the only datatypes for which there is a
difference are the ones enclosed in the ANY-FUNCTION! pseudo type.
That is, while using
print
will cause the function to be called, using
get 'print
or
:print
will just get the value the word 'PRINT refers to, i.e. the PRINT
native function.
In practice you have to use :WORD only if 1) you know the word
refers to a function and only want to get the function, not
evaluate it; or 2) you don't know what type of value the word
refers to, and you don't want it to be evaluated in the case it
was a function. In particular I suggest you to use the get-word
notation if your data is coming from an untrusted source.
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/