2009/4/2 =C5=9Eemseddin Moldibi [ Bircom ] <[email protected]>: > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On Behalf = =3D > Of Iyer > Sent: Thursday, April 02, 2009 6:55 PM > To: [email protected] > Subject: [REBOL] insert > > 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- > > > Insert returns the series after the insert. > You should use "head num", > But "print num" gives the expected output on my winxp? > > print n >>> 1 2 3 4 > > -- > To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject. > >
>> X: [1 2 3] =3D=3D [1 2 3] >> Y: insert tail X 4 =3D=3D [] >> ? X X is a block of value: [1 2 3 4] >> ? Y Y is a block of value: [] >> index? X =3D=3D 1 >> index? Y =3D=3D 5 >> head X =3D=3D [1 2 3 4] >> head Y =3D=3D [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. --=20 =E5=A5=8F=E3=81=A7=E3=81=A6=E5=A4=A2 -- To unsubscribe from the list, just send an email to lists at rebol.com with unsubscribe as the subject.
