; What does this function g* do?
; ------------------------------
; The Little Lisper 3rd Edition
; Chapter 6
; Exercise 7
; Common Lisp
; http://t...content-available-to-author-only...r.com/thelittlelisper
; http://t...content-available-to-author-only...t.com/2010/06/little-lisper-chapter-6-oh-my-gawd-its.html
; http://t...content-available-to-author-only...t.com/2010/06/little-lisper.html
; ------------------------------
(setf l1 '((fried potatoes)(baked (fried)) tomatoes))
(setf l2 '(((chili) chili (chili))))
(setf l3 '())
(setf lat1 '(chili and hot)) 
(setf lat2 '(baked fried)) 
(setf a 'fried)
; ------------------------------

(defun g* (lvec acc)
  (cond
   ((null lvec) acc)
   ((atom (car lvec))
    (g* (cdr lvec)(+ (car lvec) acc)))
   (t (g* (car lvec)(g* (cdr lvec) acc)))))

(print (g* '(1 (2 (3))) 0))
;6
'This takes a list of numbers and adds them into the accumulator (acc)

