Thanks Warren for the suggestions, it was very interesting. I think it is always good to know more than one way to do something
This "awhen" macro... I cannot count how many time i had to use this mechanism and yet i never thought of doing a macro out of it, thanks for that too
Haven't you learned Lisp yet? :D I just started few days ago :) I tried the non-destructive one in my program, but i had problem with 'with-gensyms' so i modified it to : (defmacro pop-nth (n l) (let ((nvar (gensym)) (lvar (gensym)) (ncdr (gensym))) `(let* ((,nvar ,n) (,lvar ,l) (,ncdr (nthcdr ,nva...
Thanks Gugamilare, the first one look like what i was looking for. I was hoping there was a standard function that could help in this kind of case. Something like "pop" but which can work in the middle of a list. But now i realize that the "one way" nature of the lists makes this...
Let's say i need to remove the nth element of the list "l" and push it at the beginning of list "out". The best i could figure out is : (progn (push (nth n l) out) (setf l (delete (nth n l) l)) But it looks pretty inefficient to me. "(nth n l)" is evaluated twice and &q...