[REBOL] Probable hash! bug Re:
From: al::bri::xtra::co::nz at: 20-Sep-2000 17:02
Rodney wrote:
> A hash in an object doesn't seem to act like a block.
> Here is a console session that shows the problem.
>
> >> o!: make object! [h: make hash! 10 b: make block! 10]
> >> probe o!
>
> make object! [
> h: make hash! []
> b: []
> ]
> >> obj: make o! []
> >> probe obj
>
> make object! [
> h: make hash! []
> b: []
> ]
> >> append obj/h 'one
> == make hash! [one]
> >> append obj/b 'one
> == [one]
> >> probe obj
>
> make object! [
> h: make hash! [one]
> b: [one]
> ]
> >> probe o!
>
> make object! [
> h: make hash! [one]
> b: []
> ]
> >>
>
> Huh? It seems wrong that the word 'h in o! would be changed. The normal
block 'b seems to be handled correctly, though.
Actually you've come across a "sort of" problem in Rebol. For:
obj: make o! []
'make does a _shallow_ copy of 'o!, not the _deep_ copy required. Bo
mentioned to me that:
> Carl stated that maybe something like this would be incorporated into
REBOL in the future, probably in the form of MAKE/DEEP.
There's a clone function written by Erin, that I'll post to the list soon.
Andrew Martin
ICQ: 26227169
http://members.ncbi.com/AndrewMartin/
http://members.xoom.com/AndrewMartin/