[REBOL] Re: Why I don't need get-word here!
From: greggirwin:mindspring at: 2-Nov-2003 12:25
Hi Patrick,
PPln> In a previous version of my code, I was not using the get-word
PPln> ... and it was working the same (AFAICT).
PPln> So my questions are:
PPln> - Do I need the get-word?
PPln> - Is there a difference in the result?
If your FACE values are faces (objects), you don't need to use the
get-word syntax. The get-word! prevents evaluation, that's all. Mainly
helpful with functions that you want to reference but not evaluate.
>> o: make object! [a: 1 b: "test"]
>> same? :o o
== true
>>> copypane1: copy []
PPln> == []
>>> copypane2: copy []
PPln> == []
PPln> ;
PPln> ; what is the difference between copypane1 copypane2
PPln> ;
The sameness issue is separate from the get-word issue. The difference
between copypane1 and copypane2 is that they are distinct entities. If
you change one, the other will not change as a result.
When you change the second item in one, it looks like the other one
changes as well, but it really doesn't, because the string they both
refer to is not "contained" in them, only its location is (for lack of
a better term). The blocks aren't the same, but what they refer to
*is* the same, and they just provide a level of indirection to get at
it.
HTH (and is not too confusing :).
-- Gregg