Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: copy/deep

From: rotenca:telvia:it at: 25-Jul-2003 0:50

Hi Andrew,
> Can you give an example, please?
The example was in the previous message and is the reason for which Brett collect does not work with Foreach: it uses a reference to the result block used by insert, but after the copy/deep, the reference has changed and it refers now to a copy of the the result block.
>From the previous message:
now happens: a: [] b: reduce [a a]; == [[] []] same? b/1 b/2; == true c: copy/deep b; == [[] []] same? c/1 c/2;== false Instead I should like: c: copy/deep/only b; == [[] []] same? c/1 c/2; == true Visual explanation (i hope): b is: [ 1 2 ] | | \ / a After the copy/deep c is: [ 1 2 ] | | | | copy of a another copy of a What it should be? [ 1 2 ] | | \ / copy of a --- Ciao Romano