Hi,
Here is a quick program to demonstrate this within a VID window:
rebol[
title: "Copy vs Copy/Deep"
]
show-all: does [
show [xf yf z1f z2f]
]
lay: layout [
text "click each of the buttons in turn"
across
text "x" xf: field xc: button "x: [1 2 3]" [do xc/text xf/text: x show-all]
return
text "y" yf: field yc: button "y: reduce [x]" [do yc/text yf/text: y
show-all] return
text "z1" z1f: field z1c: button "z1: copy/deep y" [do z1c/text z1f/text: z1
show-all] return
text "z2" z2f: field z2c: button "z2: copy y" [do z2c/text z2f/text: z2
show-all] return
button "remove x" [remove x show-all] text "(remove the first element from x)"
]
view/title lay "copy vs copy/deep"
Anton.
[EMAIL PROTECTED] wrote:
> If you assign multiple references
> to the same memory, then there will be a difference.
> With copy/deep, you get a separate instance of
> everything. Without it, only the reference is used.
> It may seem like a subtle point, but one still worth
> looking at. Also, if you are storing object references
> in your blocks instead of just integer values then you
> would see a difference.
>
> >> x: [a b c d]
> == [a b c d]
> >> b: []
> == []
> >> insert/only b :x
> == []
> >> b
> == [[a b c d]]
> >> c: copy b
> == [[a b c d]]
> >> d: copy/deep b
> == [[a b c d]]
> >> remove x
> == [b c d]
> >> c
> == [[b c d]]
> >> d
> == [[a b c d]]
> >>
>
> >===== Original Message From [EMAIL PROTECTED] =====
> >As my example below shows, there does not appear to a difference in handling
> nested blocks between copy and copy/deep
> >
> >>> a: [ 1 2 [ 3 [ 4 5 ] 6 ] 7 8 ]
> >== [1 2 [3 [4 5] 6] 7 8]
> >>> b: copy a
> >== [1 2 [3 [4 5] 6] 7 8]
> >>> b
> >== [1 2 [3 [4 5] 6] 7 8]
> >>> c: copy/deep a
> >== [1 2 [3 [4 5] 6] 7 8]
> >>> c
> >== [1 2 [3 [4 5] 6] 7 8]
> >>> b
> >== [1 2 [3 [4 5] 6] 7 8]
> >>> a
> >== [1 2 [3 [4 5] 6] 7 8]