[Openmcl-devel] readtable

Taoufik Dachraoui taoufik.dachraoui at wanadoo.fr
Fri Jun 5 07:15:44 PDT 2009


Hi

I created a new macro-character #\: to check and disallow access to  
not external symbols as follows:

(defun check-columns (stream char)
   (let ((ch (peek-char nil stream t nil t)))
     (if (eql ch #\:)
	(error "access to internal symbols not allowed")
	(progn
	  (unread-char #\: stream)
	  (set-macro-character #\: nil)
	  (let ((res (read stream t nil t)))
	    (set-macro-character #\: #'check-columns)
	    res)
	  ))))

(set-macro-character #\: #'check-columns)

Note: according to the book ANSI Common Lisp by Paul Graham, unread- 
char cannot be done
after a peek-char. But in my tests ccl did not complain.

Now I would like to restore the standard readtable but failed. I tried  
the following:

(set-macro-character #\: nil)

Even if I quit ccl and launch a new image I still get the following  
message when I try to access a symbol using ::


? (make-package 'test)
? (setq test::x 1)

 > Error: access to internal symbols not allowed
 > While executing: MB::CHECK-COLUMNS, in process listener(1).
 > Type :POP to abort, :R for a list of available restarts.
 > Type :? for other options.
1 >


How do I restore the standard readtable

Kind regards

-Taoufik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20090605/53a79898/attachment.htm>


More information about the Openmcl-devel mailing list