From: Lael Schooler

Subject: Problem (?) with evalhook

Date: 1997-4-28 10:40


Hi, I am trying to get the following piece of code to run in Allegro CL 3.0.
It was  taken from the common lisp manual. 

http://www-cgi.cs.cmu.edu/afs/cs.cmu.edu/misc/mosaic/common/omega/Web/Groups
/AI/html/cltl/clm/node180.html

(defvar *hooklevel* 0) 

(defun hook (x) 
  (let ((*evalhook* 'eval-hook-function)) 
    (eval x))) 

(defun eval-hook-function (form &rest env) 
  (let ((*hooklevel* (+ *hooklevel* 1))) 
    (format *trace-output* <TForm: at "~%~V>  ~S" 
            (* *hooklevel* 2) form) 
    (let ((values (multiple-value-list 
                     (evalhook form 
                               #'eval-hook-function 
                               nil 
                               env)))) 
      (format *trace-output* <TValue:~{ at "~%~V> ~S~}" 
              (* *hooklevel* 2) values) 
      (values-list values))))

According to the manual it should behave like this:

(hook '(cons (floor *print-base* 2) 'b)) 
  Form:  (CONS (FLOOR *PRINT-BASE* 2) (QUOTE B)) 
    Form:  (FLOOR *PRINT-BASE* 3) 
      Form:  *PRINT-BASE* 
      Value: 10 
      Form:  3 
      Value: 3 
    Value: 3 1 
    Form:  (QUOTE B) 
    Value: B 
  Value: (3 . B) 
(3 . B)

Instead Allegro 3.0 returns:

(5 . B) (with out printing any messages)


Does anybody know why this won't work?

thanks,

Lael