insert
[1/4] from: narayan:iyer::gmail at: 2-Apr-2009 21:24
All,
I have defined the following (on my OS X, both R2 2.7.6 & R3 A40) :
>> num: [1 2 3]
then I execute the following:
>> num: insert tail num [4], expecting [1 2 3 4]. However, I get:
>> []
>> print num
>> []
Any suggestions? Join works though!
Thanks
-Narayan-
[2/4] from: semseddinm:bircom at: 2-Apr-2009 19:03
[3/4] from: izkata::gmail::com at: 2-Apr-2009 11:09
2009/4/2 =C5=9Eemseddin Moldibi [ Bircom ] <semseddinm-bircom.com>:
> -----Original Message-----
> From: rebol-bounce-rebol.com [mailto:rebol-bounce-rebol.com] On Behalf
<<quoted lines omitted: 22>>
> lists at rebol.com with unsubscribe as the subject.
>> X: [1 2 3]
== [1 2 3]
>> Y: insert tail X 4
== []
>> ? X
X is a block of value: [1 2 3 4]
>> ? Y
Y is a block of value: []
>> index? X
== 1
>> index? Y
== 5
>> head X
== [1 2 3 4]
>> head Y
== [1 2 3 4]
Insert is inserting at the tail, then returning the series after the
inserted value. So Y is at the tail, but X still points at the head
of the series.
--
=E5=A5=8F=E3=81=A7=E3=81=A6=E5=A4=A2
[4/4] from: tim-johnsons::web::com at: 2-Apr-2009 10:10
On Thursday 02 April 2009, Iyer wrote:
> All,
> I have defined the following (on my OS X, both R2 2.7.6 & R3 A40) :
<<quoted lines omitted: 8>>
> >> []
> Any suggestions? Join works though!
Help is your friend:
>> help insert
USAGE:
INSERT series value /part range /only /dup count
DESCRIPTION:
Inserts a value into a series and returns the series after the insert.
INSERT is an action value.
ARGUMENTS:
series -- Series at point to insert (Type: series port bitset)
value -- The value to insert (Type: any-type)
REFINEMENTS:
/part -- Limits to a given length or position.
range -- (Type: number series port pair)
/only -- Inserts a series as a series.
/dup -- Duplicates the insert a specified number of times.
count -- (Type: number pair)
Note the the return value .....
thanks
Tim
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted