rotate on list
Posted: Fri Feb 27, 2004 7:58 pm
Hello Lutz,
(Linux 7.5.4)
Im currious what im doing wrong in the following example, perhpas you can
point out the mistake. I could emagin that (net-sessions) is static in itself still the first rotate Is accepted.
>(net-sessions)
(4 3)
>(rotate (net-sessions))
(3 4)
>(rotate (net-sessions))
(3 4)
As you can see the 'rotate only worked once, still rotate is destructive to the
'net-sessions list, its not updated a second time. If you would say that i should isolate the list from 'net-sessions befor doing a rotate (because of the dynamic/static behaviour of the 'net-sessions list) i'll work with that ;-)
Ofcourse a normal list works...
> (set 'x (list 1 2 3 4))
(1 2 3 4)
> (rotate x)
(4 1 2 3)
> (rotate x)
(3 4 1 2)
> (rotate x)
(2 3 4 1)
> (rotate x)
(1 2 3 4)
Regards,
Norman.
(Linux 7.5.4)
Im currious what im doing wrong in the following example, perhpas you can
point out the mistake. I could emagin that (net-sessions) is static in itself still the first rotate Is accepted.
>(net-sessions)
(4 3)
>(rotate (net-sessions))
(3 4)
>(rotate (net-sessions))
(3 4)
As you can see the 'rotate only worked once, still rotate is destructive to the
'net-sessions list, its not updated a second time. If you would say that i should isolate the list from 'net-sessions befor doing a rotate (because of the dynamic/static behaviour of the 'net-sessions list) i'll work with that ;-)
Ofcourse a normal list works...
> (set 'x (list 1 2 3 4))
(1 2 3 4)
> (rotate x)
(4 1 2 3)
> (rotate x)
(3 4 1 2)
> (rotate x)
(2 3 4 1)
> (rotate x)
(1 2 3 4)
Regards,
Norman.