Define (delete-car list) to modify and return list with the first element of list deleted.
> (setq l (list 'a 'b 'c))Solution:
(A B C)
> (delete-car l)
(B C)
> L
(B C)
(defun delete-car (l)
(setf (car l) (cadr l))
(let ((tmp (cddr l)))
(setf (cdr l) tmp))
(if (equal l '(())) nil l))
No comments:
Post a Comment