I think it should be:

    either Temp: find Series Value [remove Temp] [append Series Value]
    Series

As I believe that 'Alter should return the original Series at it's original
position, not the 'head position given by 'append. So the complete function
reads:

; Replacement 'Alter
Alter: func [
    {If a value is not found in a series, append it; otherwise, remove it.}
    Series [series! port!]
    Value
    /local Temp
    ][
    either Temp: find Series Value [remove Temp] [append Series Value]
    Series
    ]

Andrew Martin
ICQ: 26227169 http://valley.150m.com/
-><-

----- Original Message -----
From: "Brian Hawley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 10, 2002 7:42 AM
Subject: [REBOL] Re: REBOL/Core 2.5.3 Released


> At 04:32 PM 8/4/02 +0200, Andreas ([EMAIL PROTECTED]) wrote:
> >'alter in new /core is broken:
> >
> > >> s: [ 1 2 3 4 5 6 ]
> >== [1 2 3 4 5 6]
> > >> alter s 4
> >== [2 3 4 5 6]
> >
> >a quick look at the 'source reveals the problem
> >
> >   either temp: find series value [remove series] [append series value]
> >
> >should read
> >
> >   either temp: find series value [remove temp] [append series value]
> >
> >[submitted to feedback]
>
> I think it should be
>
>    either temp: find series value [head remove temp] [append series value]
>
> for consistent behavior. I submitted my version to feedback
> as well (alas, before I read your message).
>
> By the way, the function is identically broken in /View.
> Perhaps it was broken all along, but no one wrote code that
> needed it to work correctly before, just for the trivial
> case of the item always being in the first position.
>
> Brian
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to