When I read "Changes a value in a series and returns the series after the
change," I would expect to get the entire series back as so...

>> change "1234567890" "test"
== "test567890"    ;not the real return value!!!

I  make this assumption because I take the "after" to mean later in time by
default.  If it said it "returns the series before the change," I would expect
it to return the series as it was before the change occured.  While not as
inaccurate as I first interpeted this sentence, a slight change in wording could
help clarify.

Unfortuneately my suggested correction was not any better,  "changes a value in
a series and returns the part of the series after the change."  Since as Andrew
pointed out, it really is not returning the part, but more precicesly the
position.  How about this definition:  "Changes a value in a series and returns
the series behind the change."  I think that says it quite well.

Anyhow, Andrew, I like your real example of using changes return value.  I
thought later on that RT may have chosen this return value mainly because the
other positions relating to the change function are much easier to obtain.
Returning the head would be non-standard and is so easily obtained with 'head.
It probably boiled down to returning the before position or the behind the
changed position.  Since the before position is readily available, the behind
the changed position seems the obvious choice.

--Ryan

Andrew Martin wrote:

> It was written:
> > > >> help change
> > > USAGE:
> > >     CHANGE series value /part range /only /dup count
> > >
> > > DESCRIPTION:
> > >      Changes a value in a series and returns the series after the
> change.
>
> > For one the docs dont accurately describe what change does.  "Changes a
> value in a series and returns the series after the change."  I would say
> "Changes a value in a series and returns the part of the series after the
> change."
>
> Um, the docs are accurate here. Watch:
>
> >> s: "1234567890"
> == "1234567890"
> >> r: change s "def"
> == "4567890"
> >> print head r
> def4567890
> >> s
> == "def4567890"
>
> Note that 's and 'r are the same string.
>
> > Moving onto to change/part, "Limits the amount to change to a given length
> or position," is not entirely accurate since its return value indicates that
> the whole of the range was changed.  If what it does is not a bug, it would
> be somewhat more accurately said "Enforces change limited to a given length
> or position."
>
> > > REFINEMENTS:
> > >      /part -- Limits the amount to change to a given length or position.
> > >          range -- (Type: number series port)
>
> >> s: "1234567890"
> == "1234567890"
> >> r: change/part s "defghi" 2
> == "34567890"
> >> print head r
> defghi34567890
> >> print s
> defghi34567890
>
> Note that positions 1 and 2 in s have been replaced with the string
> "defghi". A length of "2" from the start of the string.
>
> >> s: "1234567890"
> == "1234567890"
> >> r: change s "defghi"
> == "7890"
> >> print head r
> defghi7890
> >> print s
> defghi7890
>
> Note that the first six characters of the string have been replaced.
>
> Andrew Martin
> ICQ: 26227169 http://members.nbci.com/AndrewMartin/
> -><-
>
> --
> 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