RE: On indexes
- Posted by rforno at tutopia.com Aug 23, 2002
- 404 views
Derek: Maybe I was the one requesting this feature.... But if I remember well, what I asked was that: x[{1, 5, 3}] was {x[1], x[5], x[3]}. I think the two approaches are worth considering, with different notations. The second one is addressed to in one of the functions in my genfunc package. ----- Original Message ----- From: Derek Parnell <ddparnell at bigpond.com> Subject: Re: On indexes > > ----- Original Message ----- > From: christian.cuvier at education.gouv.fr > To: EUforum > Sent: Friday, August 23, 2002 9:15 PM > Subject: On indexes > > >I am not asking for a t[index]=setval syntax to be available > >- too much specialized-. > > > >Hav a good week-end. > > > However, it has been requested by at least one person that sequences support > indexes that are also sequences. For example: > > a = t[{3,5,2}] > > would be equivalent to ... > > a = t[3][5][2] > > The advantage would be that it makes handling arbitary depth sequences with > generic code more easier. Currently, we have to specify in the code, the > same number of [] as there are depths. If we could code a single [] that > takes a sequence as its index value, we could then control the depth > references just by altering the number of elements in the index sequence. > > It makes writing generic code in libraries much easier. > > ---------------- > cheers, > Derek Parnell > > > >