[Openmcl-devel] openmcl read problem

Gary Byers gb at clozure.com
Wed Nov 9 22:26:39 UTC 2005


#, isn't part of ANSI CL.  It was in CLtL1, but (IIRC) was deprecated
as of CLtL2; X3J13 voted to remove it in 1998.  (The fairly obscure
things that #, did are probably done a little more cleanly/sanely
via MAKE-LOAD-FORM and LOAD-TIME-VALUE in ANSI CL.)

OpenMCL provided #, as an extension until 1.0.  It's probably been
a fairly long time (maybe not 17 years, but maybe not much less than
that ...) since it's been used in new code, and that seemed to justify
dropping that support.  Things like PCL (and its code walker) were
probably written in a time when all implementations supported #,
and few (if any) supported MAKE-LOAD-FORM and LOAD-TIME-VALUE.

The reasons for dropping #, are mostly aesthetic (it adds to the clutter,
it's been deprecated for a long time, it's easily abused and there are
better ways of doing what it tried to do.)  The reasons for retaining
it are mostly practical (useful old code uses it.)  I thought that
the aesthetic outweighed the practical.

The other part of the practical consideration - "people want to be able
to occasionally use things like the PCL code walker, and don't want to
have to jerk around with replacing #, with more modern code" - wasn't
given enough weight.  That's especially true for legacy code like PCL:
you can't nag the maintainer to fix it, since they've been doing other
things for the last few decades.

Probably the right thing would have been to move the definition of
#, to a separate file, and to just say that you need to do something
like:

(require "SHARP-COMMA")

before compiling legacy code that uses #,.  That wouldn't be -too-
onerous, it'd address the aesthetic concerns (such as they are), and
would probably be a better practical solution that just saying "it's
been deprecated for 17 years, that's long enough".

The old definition (from the 0.14.3 sources) was:

(in-package "CCL")

; This has been deprecated.  Why not nuke it ?
(set-dispatch-macro-character
  #\#
  #\,
  #'(lambda (stream subchar numarg)
      (let* ((sharp-comma-token *reading-for-cfasl*))
        (if (or *read-suppress* (not *compiling-file*) (not sharp-comma-token))
          (read-eval stream subchar numarg)
          (progn
            (require-no-numarg subchar numarg)
            (list sharp-comma-token (read stream t nil t)))))))

On Wed, 9 Nov 2005, Rick Taube wrote:


> openmcl 1.0 cant load a file with this expression in it. the file its
> taken from is called "walk.lisp" an old code walker from the pcl
> distribution. other versions of openmcl load lt:
>
> --rick
>
>
> (defun variable-globally-special-p (symbol)
>   #+Genera                      (si:special-variable-p symbol)
>   #+Cloe-Runtime		(compiler::specialp symbol)
>   #+Lucid                       (lucid::proclaimed-special-p symbol)
>   #+TI                          (get symbol 'special)
>   #+Xerox                       (il:variable-globally-special-p symbol)
>   #+(and dec vax common)        (get symbol 'system::globally-special)
>   #+(or KCL IBCL)               (si:specialp symbol)
>   #+excl                        (get symbol 'excl::.globally-special.)
>   #+:CMU			(eq (ext:info variable kind symbol) :special)
>   #+HP-HPLabs                   (member (get symbol 'impl:vartype)
> 					'(impl:fluid impl:global)
> 					:test #'eq)
>   #+:GCLISP                     (gclisp::special-p symbol)
>   #+pyramid			(or (get symbol 'lisp::globally-special)
> 				    (get symbol
> 					 'clc::globally-special-in-compiler))
>   #+(or openmcl :CORAL)                      (ccl::proclaimed-special-p
> symbol)
>   #-(or openmcl Genera Cloe-Runtime Lucid Xerox Excl KCL IBCL (and dec
> vax common) :CMU HP-HPLabs
> 	GCLisp TI pyramid :CORAL)
>   (or (not (null (member symbol *globally-special-variables* :test
> #'eq)))
>       (when (eval `(flet ((ref () ,symbol))
> 		     (let ((,symbol '#,(list nil)))
> 		       (and (boundp ',symbol) (eq ,symbol (ref))))))
> 	(push symbol *globally-special-variables*)
> 	t)))
>
>
> > Error in process listener(1): Reader error on stream
> #<FILE-CHARACTER-INPUT-STREAM ("/private/tmp/bug.lisp"/12) #x83ADED6>:
> >                               Undefined character #\, in a #\#
> dispatch macro.
> > While executing: CCL::SIGNAL-READER-ERROR
> > Type :POP to abort.
> Type :? for other options.
> 1 > *features*
> (:PRIMARY-CLASSES :CCL :CCL-2 :CCL-3 :CCL-4 :CORAL :COMMON-LISP :MCL
> :OPENMCL :ANSI-CL :PROCESSES :UNIX :OPENMCL-NATIVE-THREADS
> :OPENMCL-PARTIAL-MOP :MCL-COMMON-MOP-SUBSET :OPENMCL-MOP-2 :POWERPC
> :PPC-TARGET :PPC-CLOS :PPC32-TARGET :PPC32-HOST :DARWINPPC-TARGET
> :DARWINPPC-HOST :DARWIN :POWEROPEN-TARGET :32-BIT-TARGET :32-BIT-HOST
> :BIG-ENDIAN-TARGET :BIG-ENDIAN-HOST :OPENMCL-PRIVATE-HASH-TABLES)
> 1 >
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list