Implicit move
Posted: Thu Sep 13, 2007 9:19 pm
Hi Lutz,
I like implicit indexing a lot, it easy to use and compact...
But what i actualy miss inside implicit indexing is a simple way
to "move" variables inside lists...
Normaly I use a pop and a push to move an list/variable inside a list around, but actualy using pop en push is a little clumpsy together with implicit indexing or actualy overall for moving...
I would like to see something like i.e. this ->
> (set 'a '("one" "two" "three"))
("one" "two" "three")
> (nth-move (a 0) (a -1))
("two" "three" "one")
No its not a rotate, because then the function is getting too long again,
perhpas and extra parameter inside nth-set for moving inside lists?
Moving (like in 'pop then push) a nested list inside another nested list...or anything else..
Or perhpasd just a simple 'move function that moves inside lists
and strings...
Would be a nice to have...
Regards,
Norman.
I like implicit indexing a lot, it easy to use and compact...
But what i actualy miss inside implicit indexing is a simple way
to "move" variables inside lists...
Normaly I use a pop and a push to move an list/variable inside a list around, but actualy using pop en push is a little clumpsy together with implicit indexing or actualy overall for moving...
I would like to see something like i.e. this ->
> (set 'a '("one" "two" "three"))
("one" "two" "three")
> (nth-move (a 0) (a -1))
("two" "three" "one")
No its not a rotate, because then the function is getting too long again,
perhpas and extra parameter inside nth-set for moving inside lists?
Moving (like in 'pop then push) a nested list inside another nested list...or anything else..
Or perhpasd just a simple 'move function that moves inside lists
and strings...
Would be a nice to have...
Regards,
Norman.