[REBOL] Re: Change/part
From: jelinem1:nationwide at: 23-Feb-2001 13:01
Just to provide another opinion, I had absolutely no problem understanding
and using 'change/part from the REBOL documentation.
Also, "a part of a series" IS "a series", is it not?
I use the return of 'change when I am traversing a series and finding
elements (or imbedded series) to change. I am not necessarily changing the
sub-series with the same size series. The return from 'change provides a
convienient way of pointing to where the next element in the (original)
series is.
I see no need to change'change or its documentation. Perhaps reading about
and learning the use of 'replace helps understand the usefulness of
'change?
- Michael Jelinek
Ryan Cole <[ryanc--iesco-dms--com]>@rebol.com on 02/23/2001 12:11:04 PM
From: Ryan Cole <[ryanc--iesco-dms--com]>@rebol.com on 02/23/2001 12:11 PM
Please respond to [rebol-list--rebol--com]
Sent by: [rebol-bounce--rebol--com]
To: [rebol-list--rebol--com]
cc:
Subject: [REBOL] Re: Change/part
I agree that something is wrong here Paul,
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."
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."
This all brings to mind a question. Does anyone know the purpose of change
returning the part of the series after the change, as opposed to the whole
of
the changed series?
--Ryan
Paul Tretter wrote:
> Maybe, I am using it wrong -
>
> >> 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.
> CHANGE is an action value.
>
> ARGUMENTS:
> series -- Series at point to change (Type: series port)
> value -- The new value (Type: any)
>
> REFINEMENTS:
> /part -- Limits the amount to change to a given length or position.
> range -- (Type: number series port)
> /only -- Changes a series as a series.
> /dup -- Duplicates the change a specified number of times.
> count -- (Type: number)
> >> string: "0000000000"
> == "0000000000"
> >> series? string
> == true
> >> change/part string "2" 4
> == "000000"
> >> print head string
> 2000000
> >>
>
> Doesn't give me the result I expected. I index 4 of the string to be "2".
>
> Paul Tretter
>
> ----- Original Message -----
> From: "GS Jones" <[gjones05--mail--orion--org]>
> To: <[rebol-list--rebol--com]>
> Sent: Friday, February 23, 2001 6:03 AM
> Subject: [REBOL] Re: Change/part
>
> > From: Paul Tretter
> > > Anyone have problems with Windows based /View with Change/part?
> >
> > I haven't used it much in my programs to date, but I ran it through
some
> > tests to see if it worked as expected. It seemed to work fine in
> > Windows 98 and /View 0.10.38.3.1.
> >
> > For what its worth...
> > --Scott
> >
> > --
> > To unsubscribe from this list, please send an email to
> > [rebol-request--rebol--com] with "unsubscribe" in the
> > subject, without the quotes.
> >
>
> --
> To unsubscribe from this list, please send an email to
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Ryan Cole
Programmer Analyst
www.iesco-dms.com
707-468-5400
I am enough of an artist to draw freely upon my imagination.
Imagination is more important than knowledge. Knowledge is
limited. Imagination encircles the world.
-Einstein