Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Congrats on the release. I'm excited to finish reading the book. I just thought you should know, however, that there's a minor mistake (I think) in some of the walkthrough stuff in the pdf. On page 56:

  >  (defun pudding-eater (person)
      (cond ((eq person 'henry) (setf *arch-enemy* 'stupid-lisp-alien) '(curse you lisp alien – you ate my pudding))
  	    ((eq person 'johnny) (setf *arch-enemy* 'useless-old-johnny) '(i hope you choked on my pudding johnny))
  	    (t '(why you eat my pudding stranger ?))))

  > (pudding-eater 'johnny)
  (I HOPE YOU CHOKED ON MY PUDDING JOHNNY)

  > *arch-enemy*
  JOHNNY
arch-enemy at this time should hold the value 'useless-old-johnny, not 'johnny


Yes, you are right- You found the first errata!

At least the intent of the code is still clear.


It seems to work for me.

  CL-USER> (defvar *arch-enemy* nil)
           (defun pudding-eater (person)
             (cond  ((eq person 'henry)(setf *arch-enemy* 'stupid-lisp-alien)'(curse you lisp alien - you ate my pudding))
           	    ((eq person 'johnny)(setf *arch-enemy* 'useless-old-johnny)'(i hope you choked on my pudding johnny)) 
          	    (t'(why you ate my pudding stranger?)))) 

  PUDDING-EATER
  CL-USER> *arch-enemy* 
  NIL 
  CL-USER> (pudding-eater 'johnny) 
  (I HOPE YOU CHOKED ON MY PUDDING JOHNNY) 
  CL-USER> *arch-enemy* 
  USELESS-OLD-JOHNNY 
  CL-USER>


But LISP is immune to bugs!?! What gives??




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: