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

[REBOL] Re: "piping" functions

From: Izkata::Comcast::net at: 23-Nov-2005 22:09

> > Volker, > >>>Hard to understand what you do not understand, i hope i do it: >>>The focus is here >>>copy/part B back tail b >>>not here: >>>copy/part b BACK TAIL B > >>>copy B >>>return a copy of the series on position b. >>>copy/part B back tail b >>>returns a copy of the series on the position b, but not upto end, but >>>upto >>>back tail b > > ... yes , and what does the last BACK TAIL B evaluates to? an INDEX > position? > > Simply restated, I would like to understand why BACK TAIL B used alone > like > here: > >>>BACK TAIL B > > returns a series > > while when used in: > >>>copy/part b BACK TAIL B > > it returns a number. (I assume it returns a number because this is what > COPY/PART needs as a second argument) >
It doesn't return a number -
>> ? copy
USAGE: COPY value /part range /deep DESCRIPTION: Returns a copy of a value. COPY is an action value. ARGUMENTS: value -- Usually a series (Type: series port bitset) REFINEMENTS: /part -- Limits to a given length or position. range -- (Type: number series port pair) <-- /deep -- Also copies series values within the block. It returns a the same series at a different index. The error message that copy/part gives isn't completely correct... count (below) gives the impression that it needs to be a number, but it doesn't.
>> copy/part {a b c} {b} ;It looks like this should work...
** Script Error: Invalid /part count: b ** Near: copy/part "a b c" "b"
>> X: "a b c"
== "a b c"
>> copy/part X find X {b} ;But what it wants is part of the same series
== "a "