Remove functions from readtables?

Discussion of Common Lisp
Post Reply
porky11
Posts: 25
Joined: Fri May 02, 2014 6:46 am

Remove functions from readtables?

Post by porky11 » Thu Jun 12, 2014 3:24 am

Is it possible to remove some symbols from a readtable or to create an empty readtable, where I have to set all reader macros myself.

(copy-readtable) can only copy existing readtables and recreate the default readtable
(set-macro-character) can only set functions

This works, but it seems stupid to me:

Code: Select all

(set-syntax-from-char #\' #\x)
PS: if I redefine I also should redefine the Print-function, because of reading, but I don't find, how to do this.

Goheeca
Posts: 271
Joined: Thu May 10, 2012 12:54 pm
Contact:

Re: Remove functions from readtables?

Post by Goheeca » Thu Jun 12, 2014 4:44 am

There is only one option to edit (use some kind of an empty function in set-macro-character) setup-omnivore-readmacro*. But there is a dilemma on the line 83, it could be partially solved by creating the constant of an empty readtable in case you choose char-code-limit, I mean the speed problem of iterating over the whole set of unicode characters.
The printing part: I was discussing it in this topic.

* It's an ugly approach as I stated here (in the section Goheeca's remarks).
cl-2dsyntax is my attempt to create a Python-like reader. My mirror of CLHS (and the dark themed version). Temporary mirrors of aferomentioned: CLHS and a dark version.

marcoxa
Posts: 85
Joined: Thu Aug 14, 2008 6:31 pm

Re: Remove functions from readtables?

Post by marcoxa » Fri Jun 13, 2014 1:43 am

I know better ways to indulge in masochistic fetishes :mrgreen:
Marco Antoniotti

Post Reply