dribbling to file "aug30.session" NIL CL-USER(34): (apropos 'sqrt) ISQRT [function] (N) SQRT [function] (Z) COMP::SQRT.F COMP::PT-SQRT [function] (NODE KIDS TYPES) COMP::SQRT.D COMP::QC-FL-SQRT [function] (NODE TARGET) EXCL::FLD_SQRT [function] (X) :SQRT value: :SQRT CL-USER(35): (sqrt 25) 5.0 CL-USER(36): (sqrt 54.2) 7.362065 CL-USER(37): (do-problem 4f (sqrt 25)) Error: Attempt to take the value of the unbound variable `4F'. [condition type: UNBOUND-VARIABLE] Restart actions (select using :continue): 0: Try evaluating 4F again. 1: Set the symbol-value of 4F and use its value. 2: Use a value without setting 4F. 3: Return to Top Level (an "abort" restart) 4: Abort # [1] CL-USER(38): :reset CL-USER(39): (do-problem '4f (sqrt 25)) Error: Attempt to take the value of the unbound variable `X'. [condition type: UNBOUND-VARIABLE] Restart actions (select using :continue): 0: Try evaluating X again. 1: Use :X instead. 2: Set the symbol-value of X and use its value. 3: Use a value without setting X. 4: Return to Top Level (an "abort" restart) 5: Abort # [1] CL-USER(40): :pop CL-USER(41): (do-problem '4f (sqrt 25)) 4F 5.0 5.0 CL-USER(42): (do-problem '4f '(sqrt 25)) 4F (SQRT 25) (SQRT 25) CL-USER(43): (format t "hello") hello NIL CL-USER(44): (format t "hello %d times" 5) hello %d times NIL CL-USER(45): (format t "hello ~d times" 5) hello 5 times NIL CL-USER(46): (format t "hello ~Dd times" 5) hello 5d times NIL CL-USER(47): (format t "hello ~D times" 5) hello 5 times NIL CL-USER(48): 5 5 CL-USER(49): (eval 5) 5 CL-USER(50): (+ 1 2) 3 CL-USER(51): (eval (+ 1 2)) 3 CL-USER(52): (eval '(+ 1 2)) 3 CL-USER(53): (do-problem '4f '(sqrt 25)) 4F (SQRT 25) -------------------------------- Problem 4F: (SQRT 25) => 5.0 NIL CL-USER(54): (defun mysqrt (x) (+ x 1) (* x 2) (sqrt x)) MYSQRT CL-USER(55): (mysqrt 25) 5.0 CL-USER(56): (defun mysqrt (x) (+ x 1) (* x 2) (sqrt x) ' ') Warning: ignoring extra right parenthesis Error: Received signal number 2 (Keyboard interrupt) [condition type: INTERRUPT-SIGNAL] Restart actions (select using :continue): 0: continue computation 1: Abort # [1c] CL-USER(57): :pop CL-USER(58): (defun mysqrt (x) (+ x 1) (* x 2) (sqrt x) " ") MYSQRT CL-USER(59): (mysqrt 25) " " CL-USER(60): (do-problem '4f '(sqrt 25)) -------------------------------- Problem 4F: (SQRT 25) => 5.0 NIL CL-USER(61): (load "a1.lisp") ; Loading /home/anderson/cs440/a1.lisp -------------------------------- Problem 4F: (SQRT 25) => 5.0 T CL-USER(62): (setf x 1) 1 CL-USER(63): (let ((x 1) (y 2) (z (+ 2 4))) (print (list x y z))) (1 2 6) (1 2 6) CL-USER(64): CL-USER(64): (let ((x 1) (y 2) (z (+ 2 4))) (list x y z)) (1 2 6) CL-USER(65): CL-USER(65): y Error: Attempt to take the value of the unbound variable `Y'. [condition type: UNBOUND-VARIABLE] Restart actions (select using :continue): 0: Try evaluating Y again. 1: Use :Y instead. 2: Set the symbol-value of Y and use its value. 3: Use a value without setting Y. 4: Return to Top Level (an "abort" restart) 5: Abort # [1] CL-USER(66): :pop CL-USER(67): (let ((x 1) (y 2) (z (+ 2 4))) (setf yy (+ y 2)) (list x y z)) (1 2 6) CL-USER(68): CL-USER(68): CL-USER(68): y Error: Attempt to take the value of the unbound variable `Y'. [condition type: UNBOUND-VARIABLE] Restart actions (select using :continue): 0: Try evaluating Y again. 1: Use :Y instead. 2: Set the symbol-value of Y and use its value. 3: Use a value without setting Y. 4: Return to Top Level (an "abort" restart) 5: Abort # [1] CL-USER(69): :pop CL-USER(70): yy 4 CL-USER(71): (dolist (x '(1 2 3)) (print x)) 1 2 3 NIL CL-USER(72): (dolist (x '(1 2 3) 'return-me) (print x)) 1 2 3 RETURN-ME CL-USER(73): (dolist (x '(1 (2 3) 3) 'return-me) (print x)) 1 (2 3) 3 RETURN-ME CL-USER(74): (defun countem (lst) (let ((count 0)) (dolist (x lst) (setf count (+ 1 count))))) COUNTEM CL-USER(75): (countem '(1 2 3)) NIL CL-USER(76): (defun countem (lst) (let ((count 0)) (dolist (x lst count) (setf count (+ 1 count))))) COUNTEM CL-USER(77): (countem '(1 2 3)) 3 CL-USER(78): (countem '(1 2 44)) 3 CL-USER(79): (defun countem (lst) (let ((count 0)) (dolist (x lst) (setf count (+ 1 count))) count)) COUNTEM CL-USER(80): (countem '(1 2 44)) 3 CL-USER(81): (length '(1 2 3)) 3 CL-USER(82): (dotimes (i 4) (print i)) 0 1 2 3 NIL CL-USER(83): (do ((i 0 (+ i 1))) ((> i 10) 'done) (format t "~a ~a ~%" i (* i i))) 0 0 1 1 2 4 3 9 4 16 5 25 6 36 7 49 8 64 9 81 10 100 DONE CL-USER(84): (setf op '+) + CL-USER(85): op + CL-USER(86): (op 1 2) Error: attempt to call `OP' which is an undefined function. [condition type: UNDEFINED-FUNCTION] Restart actions (select using :continue): 0: Try calling OP again. 1: Return a value instead of calling OP. 2: Try calling a function other than OP. 3: Setf the symbol-function of OP and call it again. 4: Return to Top Level (an "abort" restart) 5: Abort # [1] CL-USER(87): :pop CL-USER(88): op + CL-USER(89): '(op 1 2) (OP 1 2) CL-USER(90): (funcall '+ 1 2) 3 CL-USER(91): (funcall #'+ 1 2) 3 CL-USER(92): (funcall op 1 2) 3 CL-USER(93): (setf op '-) - CL-USER(94): (funcall op 1 2) -1 CL-USER(95): (apply op '(1 2)) -1 CL-USER(96): (setf op '+) + CL-USER(97): (apply op '(1 2)) 3 CL-USER(98): (+ 1 2 3 4 5 6 7) 28 CL-USER(99): (apply op '(1 2 3 4 5)) 15 CL-USER(100): (apply 'sqrt '(1)) 1.0 CL-USER(101): (apply 'sqrt '(12 3 4)) Error: SQRT got 3 args, wanted 1 arg. [condition type: PROGRAM-ERROR] Restart actions (select using :continue): 0: Return to Top Level (an "abort" restart) 1: Abort # [1] CL-USER(102): :pop CL-USER(103): :pop CL-USER(104): (dribble)