Greetings! OK this is in -- thanks! Robert Boyer <[EMAIL PROTECTED]> writes:
> >From boyer Thu Aug 11 18:14:41 -0500 2005 > To: [EMAIL PROTECTED] > Subject: #+ and #- bug fix ? > > > Some code in lsp/gcl_autoload.lsp needs to be changed to make #+ and > #- work according to the ANSI spec. There are two particular > requirements not being met currently. (1) The expression right after > #+ and #- is supposed to be read in the keyword package. (2) The test > for an atomic feature is supposed to be "is an element of the list > held by the variable *features*." > > While I tend to think that code below is now correct, I'm not so sure what > its consequences will be on previously happy users. It may break some > programs that were relying on the older behavior. So I'm not sure what to > recommend. > > Bob > > ------------------------------------------------------------------------------- > A replacement for a part of lsp/gcl_autoload.lsp > > ;;; Go into LISP. > (in-package 'lisp) > > ;(defvar *features*) > > (defvar *keyword-package* (find-package "KEYWORD")) > > (defun eval-feature (x) > (cond ((atom x) > (member x *features*)) > ((eq (car x) :and) > (dolist (x (cdr x) t) (unless (eval-feature x) (return nil)))) > ((eq (car x) :or) > (dolist (x (cdr x) nil) (when (eval-feature x) (return t)))) > ((eq (car x) :not) > (not (eval-feature (cadr x)))) > (t (error "~S is not a feature expression." x)))) > > ;;; Revised by Marc Rinfret. > (defun sharp-+-reader (stream subchar arg) > (if (eval-feature (let ((*read-suppress* nil) > (*read-base* 10.) > (*package* *keyword-package*)) > (read stream t nil t))) > (values (read stream t nil t)) > (let ((*read-suppress* t)) (read stream t nil t) (values)))) > > (set-dispatch-macro-character #\# #\+ 'sharp-+-reader) > (set-dispatch-macro-character #\# #\+ 'sharp-+-reader > (si::standard-readtable)) > > (defun sharp---reader (stream subchar arg) > (if (eval-feature (let ((*read-suppress* nil) > (*read-base* 10.) > (*package* *keyword-package*)) > (read stream t nil t))) > (let ((*read-suppress* t)) (read stream t nil t) (values)) > (values (read stream t nil t)))) > > (set-dispatch-macro-character #\# #\- 'sharp---reader) > (set-dispatch-macro-character #\# #\- 'sharp---reader > (si::standard-readtable)) > > > > > -- Camm Maguire [EMAIL PROTECTED] ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah _______________________________________________ Gcl-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/gcl-devel
