nested push
Posted: Sat May 21, 2005 8:57 am
Hi Lutz,
Is it possible to enhance 'push with the option of a nested list push?
Example ->
> (setq test '( (one "line") (two "lines") ))
((one "line") (two "lines"))
;; this looks logic but is not possible.. ->
> (push "quotes" (test 0) -1)
"quotes"
> test
((one "line") (two "lines"))
>
> (push "quotes" (nth 0 test) -1)
"quotes"
> test
((one "line") (two "lines"))
>
;; instead this is how it is done now...
> (push "quotes" test '(0 -1))
"quotes"
> test
((one "line" "quotes") (two "lines"))
>
So actualy "what is logic to use?" Im was just programming ahead and
thought my guess was logic though it was not :) I understand the relation
between 'ref and 'push though the above would make push even more
flexible in total. The same goes for 'pop.
Norman.
Is it possible to enhance 'push with the option of a nested list push?
Example ->
> (setq test '( (one "line") (two "lines") ))
((one "line") (two "lines"))
;; this looks logic but is not possible.. ->
> (push "quotes" (test 0) -1)
"quotes"
> test
((one "line") (two "lines"))
>
> (push "quotes" (nth 0 test) -1)
"quotes"
> test
((one "line") (two "lines"))
>
;; instead this is how it is done now...
> (push "quotes" test '(0 -1))
"quotes"
> test
((one "line" "quotes") (two "lines"))
>
So actualy "what is logic to use?" Im was just programming ahead and
thought my guess was logic though it was not :) I understand the relation
between 'ref and 'push though the above would make push even more
flexible in total. The same goes for 'pop.
Norman.