[REBOL] Bug! - 'second on object containing ONE hash! has TWO hash! !! Re:
From: larry:ecotope at: 5-Oct-2000 20:53
Well, the TWO hash is not a problem and has always been this way. Remember
that every object! has the reference 'self as its first element. Second
returns a block with the values of every set-word in the object including
the complete object as the value of 'self. Probe avoids showing the value of
It is interesting that second shows the actual hash as having the value
[...] which is the new indicator for a recursive block, hash, list, object,
etc. Probe shows the actual value, as does
>>mold second second o
It would be nice to hear from RT as to whether the [...] in your example is
the intended behavior.
In any case, everything about the object and it use is functional, it can be
saved, loaded, etc. You can bind to the hash, etc.
BTW The same thing happens with when you put a block, list, or another
object in the outer object.
Here is a related fun puzzle ;-)
>> b: [1 2]
== [1 2]
>> b/2: b
== [1 [...]]
>> save %junk.txt b
>> b2: load %junk.txt
== [1 [...]
>> second b
== [1 [...]]
>> second b2
>> first second b
>> first second b2
So it is possible to create a block which cannot be saved and loaded. This
may be a bug in load. Only RT knows what lurks in the heart of REBOL. ;-)
PS You can make a recursive block which cannot be saved and loaded.
----- Original Message -----
Sent: Thursday, October 05, 2000 8:40 PM
Subject: [REBOL] Bug! - 'second on object containing ONE hash! has TWO hash!