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

[REBOL] Re: reduce/deep

From: ingo:2b1 at: 21-Oct-2003 22:33

Robert M. Münch wrote:
> On Mon, 20 Oct 2003 12:33:29 +1000, Anton Rolls <[antonr--iinet--net--au]> > wrote: > >>Use SAME? >> >>a: b: [123] >>same? a b >>;== true > > Hi, ahhh forgot about this one. Rebol just has to many words to remember > ;-) But this doesn't seem to work for nested blocks: > >>>a: [a 1 b 2] > > == [a 1 b 2] > >>>b: [a 1 b 2] > > == [a 1 b 2] > >>>same? a b > > == false > >>>d: reduce [a b] > > == [[a 1 b 2] [a 1 b 2]] > >>>e: reduce [a b] > > == [[a 1 b 2] [a 1 b 2]] > >>>same? d e > > == false > > So I tink for nested structures we would need something like a same?/deep. > Robert
But it _works_ those two blocks are not the same ...
>> append d 1
== [[a 1 b 2] [a 1 b 2] 1]
>> e
== [[a 1 b 2] [a 1 b 2]] on the other hand ...
>> same? d/1 e/1
== true
>> append d/1 1
== [a 1 b 2 1]
>> d
== [[a 1 b 2 1] [a 1 b 2] 1]
>> e
== [[a 1 b 2 1] [a 1 b 2]] Kind regards, Ingo