* to cut the next cons cell from list:
(setf l (list 'a 'b 'c))
> (A B C)
(setf (cdr l) (cdr (cdr l)))
> (C)
l
> (A C)
may be used. I just wonder whether there is a builtin function/macro in
common-lisp spec for this functionality (or similar to this...)
regards
--
(+::+) oni (+::+)
(I already try to be as amusing as possible, my master!)
Onay Urfalioglu wrote:
> * to cut the next cons cell from list:
>
> (setf l (list 'a 'b 'c))
>> (A B C)
> (setf (cdr l) (cdr (cdr l)))
>> (C)
> l
>> (A C)
>
> may be used. I just wonder whether there is a builtin function/macro in
> common-lisp spec for this functionality (or similar to this...)
>
> regards
>
Ok ok:
(setf list (list 'a 'b 'c))
(pop (cdr list))
list
> (A C)
(push 'b (cdr list))
list
> (A B C)
sorry, i am learning ;-)
--
(+::+) oni (+::+)
(I already try to be as amusing as possible, my master!)
Onay Urfalioglu <·····@gmx.net> writes:
>
> * to cut the next cons cell from list:
>
> (setf l (list 'a 'b 'c))
> > (A B C)
> (setf (cdr l) (cdr (cdr l)))
> > (C)
> l
> > (A C)
>
> may be used. I just wonder whether there is a builtin function/macro in
> common-lisp spec for this functionality (or similar to this...)
It's hard to see how much more concise than
(setf (cdr l) (cddr l))
you could really get. But if you want it, there's always macros:
(defmacro splice-out-cdr (list)
`(setf (cdr ,list) (cddr ,list)))
(splice-out-cdr l)
--
Thomas A. Russ, USC/Information Sciences Institute
+ ···@sevak.isi.edu (Thomas A. Russ):
| It's hard to see how much more concise than
|
| (setf (cdr l) (cddr l))
|
| you could really get.
Your newsfeed has got to be pretty bad if you didn't see the OP's own
(pop (cdr l)), posted four days ago. (I didn't think of that either.)
You should complain to your provider.
--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- Debating gives most of us much more psychological satisfaction
than thinking does: but it deprives us of whatever chance there is
of getting closer to the truth. -- C.P. Snow