Having trouble deleting first item in list
- From: "jonathon" <j_mckitrick@xxxxxxxxxxx>
- Date: 28 Jun 2005 07:05:00 -0700
This one has me confused. I have a list of objects. Here is the
function to delete one of them:
(defun delete-transaction (index)
:documentation "Delete a transaction."
(decf index)
(with-tm *tm*
(setf transactions (delete (nth index transactions) transactions)))
; (delete (nth index transactions) transactions))
(format t "(tm) Transactions left: ~A~%" (count-transactions)))
'*tm*' is an object that holds transaction objects.
'transactions' is the list of transaction objects internal to *tm*.
This version of the function works as expected. But when I uncomment
the one line and comment out the setf line, it will never delete the
first (zeroth) entry. Why is this?
.
- Follow-Ups:
- Re: Having trouble deleting first item in list
- From: jayessay
- Re: Having trouble deleting first item in list
- From: Matthias Buelow
- Re: Having trouble deleting first item in list
- From: Kent M Pitman
- Re: Having trouble deleting first item in list
- Prev by Date: Re: matlisp/cmucl/macosx (or alterantive matrix library)
- Next by Date: Re: ILC2005: McCarthy denounces Common Lisp, "Lisp", XML, and Rahul
- Previous by thread: Re: [OT] can anyone offer Lisp job?
- Next by thread: Re: Having trouble deleting first item in list
- Index(es):
Relevant Pages
|