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

[REBOL] Re: reduce/deep

From: robert:muench:robertmuench at: 22-Oct-2003 20:17

On Tue, 21 Oct 2003 22:33:11 +0200, Ingo Hohmann <[ingo--2b1--de]> wrote:
> 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]]
Hi, hmmm... the help for reduce reads: Evaluates an expression or block expressions and returns the result. This means that reduce [...] will create a new block, which is the container for the result. Even the experssions inside the block don't give you a hint, that a new block is created. 'same? takes the (new created) cotainer block into account as well.
> 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]]
If we only had a script that would plot a graph of such relations... BTW: Do we have an inverse 'same? perhaps 'like-me? which lists all words where foreach hit like-me? me [(true = same? me hit) = true] always holds? -- Robert M. Münch Management & IT Freelancer Mobile: +49 (177) 245 2802 http://www.robertmuench.de