;; Dribble of # started on NIL. # [2]> ( defun innerProduct ( a-b-pair ) ( reduce + ( mapcar * ( first a-b-pair) ( second a-b-pair ) ) ) ) INNERPRODUCT [3]> (innerproduct '((2 3 4 5)(4 5 6 7))) *** - EVAL/APPLY: too many arguments given to INNERPRODUCT The following restarts are available: ABORT :R1 Abort main loop Break 1 [4]> abort [5]> (innerproduct '((2 3 4 5) (4 5 6 7))) *** - EVAL/APPLY: too many arguments given to INNERPRODUCT The following restarts are available: ABORT :R1 Abort main loop Break 1 [6]> abort [7]> (innerproduct '((2 3 4 5) (4 5 6 7)) ) *** - EVAL/APPLY: too many arguments given to INNERPRODUCT The following restarts are available: ABORT :R1 Abort main loop Break 1 [8]> abort [9]> ( defun innerProduct ( mtx ) ( reduce + ( mapcar * (car mtx) ( cadr mtx ) ) ) ) INNERPRODUCT [10]> (innerproduct '((1 2 3)(4 5 6))) *** - EVAL/APPLY: too many arguments given to INNERPRODUCT The following restarts are available: ABORT :R1 Abort main loop Break 1 [11]> abort [12]> ( defun innerProduct ( mtx ) ( mapcar '* (car mtx) ( cadr mtx ) ) ) INNERPRODUCT [13]> (innerproduct '((1 2 3)(4 5 6))) (4 10 18) [14]> (reduce '+ '(4 10 18)) 32 [15]> ( defun innerProduct ( mtx ) (reduce '+ ( mapcar '* (car mtx) ( cadr mtx ) ) )) INNERPRODUCT [16]> (innerproduct '((1 2 3)(4 5 6))) 32 [17]> (innerproduct '((1 2 3 5 6)(4 5 6 8 9))) 126 [18]> (apply 'mapcar 'list ((2 3 4 5)(3 4 5 6)(1 2 3 4))) *** - EVAL: (2 3 4 5) is not a function name; try using a symbol instead The following restarts are available: USE-VALUE :R1 Input a value to be used instead. ABORT :R2 Abort main loop Break 1 [19]> abort [20]> (apply 'mapcar 'list '((2 3 4 5)(3 4 5 6)(1 2 3 4))) ((2 3 1) (3 4 2) (4 5 3) (5 6 4)) [21]> (mapcar 'list '((2 3 4 5)(3 4 5 6)(1 2 3 4)) ) (((2 3 4 5)) ((3 4 5 6)) ((1 2 3 4))) [22]> (mapcar 'list '(2 3 4 5) '(3 4 5 6) '(1 2 3 4))) ((2 3 1) (3 4 2) (4 5 3) (5 6 4)) [23]> *** - READ from # # #> # #>>> : an object cannot start with #\) The following restarts are available: ABORT :R1 Abort main loop Break 1 [24]> abort [25]> (mapcar 'list '(2 3 4 5) '(3 4 5 6) '(1 2 3 4)) ((2 3 1) (3 4 2) (4 5 3) (5 6 4)) [26]> (apply 'mapcar 'list '((2 3 4 5) (3 4 5 6) (1 2 3 4))) ((2 3 1) (3 4 2) (4 5 3) (5 6 4)) [27]> (+ (* 3 4) (*7 6) (* 4 5)) *** - EVAL: undefined function *7 The following restarts are available: USE-VALUE :R1 Input a value to be used instead of (FDEFINITION '*7). RETRY :R2 Retry STORE-VALUE :R3 Input a new value for (FDEFINITION '*7). ABORT :R4 Abort main loop Break 1 [28]> abort [29]> (+ (* 3 4) (* 7 6) (* 4 5)) 74 [30]> (mapcar 'setf ((get 'chair 'color) (get 'chair 'owner)) '(red john)) *** - EVAL: (GET 'CHAIR 'COLOR) is not a function name; try using a symbol instead The following restarts are available: USE-VALUE :R1 Input a value to be used instead. ABORT :R2 Abort main loop Break 1 [31]> (mapcar #'(lambda ( x y) (setf x y)) ((get 'chair 'color) (get 'chair 'owner)) '(red john)) *** - EVAL: (GET 'CHAIR 'COLOR) is not a function name; try using a symbol instead The following restarts are available: USE-VALUE :R1 Input a value to be used instead. ABORT :R2 Abort debug loop ABORT :R3 Abort main loop Break 2 [32]> abort Break 1 [31]> (mapcar #'(lambda ( x y) (setf x y)) ((get 'chair 'color) (get 'chair 'owner)) '(red john)) *** - EVAL: (GET 'CHAIR 'COLOR) is not a function name; try using a symbol instead The following restarts are available: USE-VALUE :R1 Input a value to be used instead. ABORT :R2 Abort debug loop ABORT :R3 Abort main loop Break 2 [33]> (get 'chair 'color) NIL Break 2 [33]> (mapcar 'setf ((get 'chair 'color) (get 'chair 'owner)) '(red john)) *** - EVAL: (GET 'CHAIR 'COLOR) is not a function name; try using a symbol instead The following restarts are available: USE-VALUE :R1 Input a value to be used instead. ABORT :R2 Abort debug loop ABORT :R3 Abort debug loop ABORT :R4 Abort main loop Break 3 [34]> (mapcar #'(lambda ( x y) (setf (eval x) y)) ((get 'chair 'color) (get 'chair 'owner)) '(red john)) *** - EVAL: (GET 'CHAIR 'COLOR) is not a function name; try using a symbol instead The following restarts are available: USE-VALUE :R1 Input a value to be used instead. ABORT :R2 Abort debug loop ABORT :R3 Abort debug loop ABORT :R4 Abort debug loop ABORT :R5 Abort main loop Break 4 [35]> abort Break 3 [34]> abort Break 2 [33]> abort Break 1 [31]> abort [36]> (defun setprop (obj pro val) (setf (get obj pro) val)) SETPROP [37]> (setprop'chair 'color 'red) RED [38]> (setprop 'chair 'color 'red) RED [39]> (setq objs '(chair house car)) (CHAIR HOUSE CAR) [40]> objs (CHAIR HOUSE CAR) [41]> (mapcar 'setprop objs '(owner color shape) '(john red square)) (JOHN RED SQUARE) [42]> (mapcar 'get objs '(owner color shape)) (JOHN RED SQUARE) [43]> (dribble) 2009-07-08 22:06:01 ;; Dribble of # finished on NIL.