[REBOL] Re: head reverse annoys me
From: hallvard:ystad-oops:as:no at: 17-Dec-2004 10:33
It will not break, since
head head "123"
is identical to
i.e. if 'reverse were to do 'head all by itself,
performing an extra 'head on the series won't change
anything. I haven't seen _any_ examples of 'reverse being
used _without_ 'head (situations where scrips might
actually break), as Carl pointed out in his post.
Then there is the current inconsistency in 'reverse:
tuples! and pairs! (since they are not series!) will not
be "empty" after being reversed (see
And then there are lists! :
>> reverse to-list [1 2 3]
== make list! 
>> head reverse to-list [1 2 3]
== make list! [3 2 1]
>> index? reverse [1 2 3] ; block
>> index? reverse to-list [1 2 3] ; list
An odd difference, if you ask me. Maybe this could be done
more logical too, if 'reverse's behaviour were to change?
On Thu, 16 Dec 2004 15:29:04 EST
>> I'm not sure if anyone has been annoyed by REVERSE
>> the tail position. I know I have. Everywhere I see
>> like this: ... head reverse foo.
>But used? Yes -- quite commonly.
>I've scanned a pile of code and found it on several
>Typically something like:
>if user-display-option = "earliest first" [
> data: head reverse data
>foreach item data [ .... ]
>Sadly, all that code would break.
>How about a related word?
> invert: func [item] [head reverse item]
>To unsubscribe from the list, just send an email to
>at rebol.com with unsubscribe as the subject.