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

[REBOL] Re: Why does 'reverse returns the tail of the block?

From: brett:codeconscious at: 12-Nov-2002 17:41

> I suspect that 'reverse returns the 'tail of the block, because to return > the 'head of the block could be wrong, if one is 'reverse-ing only part of
> block? For example:
Probably a little more accurate to say that reverse returns the tail of the changed sequence. Having reverse return a modified series reference probably gives a little more info than just returning the original series reference, especially when you include the /PART refinement:
>> s2: reverse/part at s1: [1 2 3 4 5] 2 3
== [5]
>> s1
== [1 4 3 2 5]
>> s2
== [5]
> Though I'm not sure why one would want to only reverse part of a block (or > series)?
Insert, Change, Remove, Find, Copy, Uppercase all have a part sequence effect - seems reasonable for REVERSE to have one too :^) Regards, Brett.