Hi,
Is there an efficient way of implementing push functionality on a list (== circular traversing == removing last element and appending to the beginning of the list || removing first element and adding to the end of the list)?
List elements are not uniq. List can be very long, so I am searching for an efficient way.
I tried such implementation and it seems to be fine, just not sure, if the most efficient.
searchQueue1=lconc( nil list(1 2 3 4 5 6 7 8 9 ))
cadr(tconc(searchQueue1 popf(car(searchQueue1))))
and to reverse order:
searchQueue1=lconc(nil reverse(car(searchQueue1)))
cadr(tconc(searchQueue1 popf(car(searchQueue1))))
Please let me know, if there is a more efficient way of doing the same.
Thanks and best regards
Blaz