[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in 2-3-88 beta release?



    Date: Sat, 6 Feb 88 17:52:18 PST
    From: jam%entropy.ms@beaver.cs.washington.edu (John Alan McDonald)

    For "beta test release of Febuary 3rd 1988",
    the walker chokes on <scl:with-character-style> in the following,
    under Symbolics Genera 7.1. This didn't happen in the Aug 87
    release.

Right, although I suspect the real bug was in the earlier release.  The
problem here is that zl:named-lambda is a special form which doesn't
exist in Common Lisp.  Many lisps have named-lambda though so what I
have done is to teach the walker about named lambda in general and then
tell it specifically that zl:named-lambda is the name of the
named-lambda in zetalisp.

To fix this for yourself, make the following changes to the walk.lisp
file: 

After the line:
(define-walker-template COND ..)

Add these 2 lines:
#+Symbolics
(define-walker-template zl::named-lambda walk-named-lambda)

After the defun of walk-lambda, add this definition:

(defun walk-named-lambda (form context old-env)
  (walker-environment-bind (new-env old-env)
    (let* ((name (cadr form))
	   (arglist (caddr form))
           (body (cdddr form))
           (walked-arglist (walk-arglist arglist context new-env))
           (walked-body
             (walk-declarations body #'walk-repeat-eval new-env)))
      (relist* form
               (car form)
	       name
	       walked-arglist
               walked-body))))

Then replace the definition of walk-template with this one:

(defun walk-template (form template context env)
  (if (atom template)
      (ecase template
        ((EVAL FUNCTION TEST EFFECT RETURN)
         (walk-form-internal form :EVAL env))
        ((QUOTE NIL) form)
        (SET
          (walk-form-internal form :SET env))
        ((LAMBDA CALL)
	 (if (symbolp form)
	     form
	     (walk-form-internal form context env))))
      (case (car template)
        (REPEAT
          (walk-template-handle-repeat form
                                       (cdr template)
				       ;; For the case where nothing happens
				       ;; after the repeat optimize out the
				       ;; call to length.
				       (if (null (cddr template))
					   ()
					   (nthcdr (- (length form)
						      (length
							(cddr template)))
						   form))
                                       context
				       env))
        (IF
	  (walk-template form
			 (if (if (listp (cadr template))
				 (eval (cadr template))
				 (funcall (cadr template) form))
			     (caddr template)
			     (cadddr template))
			 context
			 env))
        (REMOTE
          (walk-template form (cadr template) context env))
        (otherwise
          (cond ((atom form) form)
                (t (recons form
                           (walk-template
			     (car form) (car template) context env)
                           (walk-template
			     (cdr form) (cdr template) context env))))))))

These changes will all appear in the next version of PCL as well.
-------