[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] Re: yet another reminder from August, nag, nag
From: |
Camm Maguire |
Subject: |
[Gcl-devel] Re: yet another reminder from August, nag, nag |
Date: |
13 Oct 2005 21:18:20 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Greetings! OK this is in -- thanks!
Robert Boyer <address@hidden> writes:
> >From boyer Thu Aug 11 18:14:41 -0500 2005
> To: address@hidden
> 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 address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gcl-devel] Re: yet another reminder from August, nag, nag,
Camm Maguire <=