[Ecls-list] Bug in two-argument copy-readtable

Faré fahree at gmail.com
Sun Mar 11 21:29:05 UTC 2007


When I try to compile Exscribe with ECL and GCL, and I hit the
following problem,
which I believe is a common bug in both ECL and GCL, since Exscribe
works great with
sbcl, cmucl, clisp, openmcl, allegro. I am using ecl-0.9i-2 and
gclcvs-2.7.0-64.1 on debian i386.

Exscribe depends on scribble, which itself depends on meta.
Both scribble and meta modify the readtable to offer specialized
syntax extensions.
Unhappily, ecl seems to disregard the change in readtable
(done by meta using (copy-readtable *meta-readtable* *readtable*)).

(in-package :cl-user)
(eval-when (:compile-toplevel :load-toplevel :execute)
  (asdf:oos 'asdf:load-op :meta))
(eval-when (:compile-toplevel :load-toplevel :execute)
  (meta:enable-meta-syntax))
(format t "~%~%Correct answer below should be META::META, not SYMBOL~%")
(format t "~S~%" (type-of (cadr (read-from-string "(match { a b c })"))))

Here is an attempt to reduce the problem to its minimal form.
It works great on sbcl, cmucl, clisp, and fails on ecl and gcl.

(in-package :cl-user)
(eval-when (:compile-toplevel :load-toplevel :execute)
  (defparameter *saved-readtable* (copy-readtable))
  (defparameter *foo-readtable* (copy-readtable))
  (set-macro-character
   #\@ #'(lambda (s c) (declare (ignore s c)) :AROBASE) nil *foo-readtable*)
  (copy-readtable *foo-readtable* *readtable*))
(format t "~%~%Correct answer below should be :AROBASE, not @~%")
(format t "~S~%" '@) ;==> instead is @ with ECL or GCL
(eval-when (:compile-toplevel :load-toplevel :execute)
  (setf *readtable* *foo-readtable*))
(format t "~%~%Correct answer below should be :AROBASE~%")
(format t "~S~%" '@) ;==> works on all platforms.

Apparently, copy-readtable doesn't work as advertised with two arguments.

NB: eval-when's are to make the file compiler happy, since I test all
implementations with cl-launch.

Hopefully, fixing that bug will make Exscribe work on said platforms.

[ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ]
"No man's life, liberty, or property is safe while
the legislature is in session."
        -- Judge Gideon J. Tucker, 1866.




More information about the ecl-devel mailing list