[Openmcl-devel] readtable
Daniel Dickison
danieldickison at gmail.com
Fri Jun 5 07:18:11 PDT 2009
How about using with-standard-io-syntax?
http://www.lispworks.com/documentation/HyperSpec/Body/m_w_std_.htm
On Jun 5, 2009, at 10:15 AM, Taoufik Dachraoui wrote:
> 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
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
More information about the Openmcl-devel
mailing list