Search found 1 match
- Mon Sep 06, 2010 6:04 am
- Forum: Common Lisp
- Topic: New to LISP could use some help...thanks.
- Replies: 5
- Views: 5781
Re: New to LISP could use some help...thanks.
defun add-product (alst widget quantity) (if (assoc widget *products* (setf (cdr (assoc widget *products*)) (+ quantity (cdr (assoc widget *products*)))) ;if key present update quantity (setf *products*(acons widget quantity *products*)))) ;else add (key . data) to alst ;;; Greets