0
votes

Standard common-lisp defines many reader macros such as ( and ) for grouping, ' for quote, " for string quotation, | for symbol quotation, # for dispatch macro, etc. Now I want to disable them all and use my own ones, and I have to call set-macro-character one by one to disable them all and then define my own ones.

I have found that there's one way to restore all reader macros to standard ones by calling (setf *readtable* (copy-readtable nil)), but is there a way to set them to empty(i.e., all the characters are treated as normal letters and numbers)?

1
What would an empty readtable do? It could be really empty, then you can read nothing with it. "all the characters are treated as normal letters and numbers" - what would that mean? Would READ assemble symbols and numbers? A Readtable is a configuration of the reader, which is mainly invoked by READ.Rainer Joswig
@RainerJoswig I'm trying to transfer lisp to a pure lambda calculus interpreter, just for study purpose. I want to use lowercase letters as well as some other characters(e.g., ', |, #) as symbol names, so I have to do this.SaltyEgg
Just parse it manually or with some parser generator, it is not that difficult.monoid

1 Answers

3
votes

I don't think there's a way. The expectation is that you're just making incremental modifications to the Lisp reader, not trying to replace it wholesale. It's not really designed to be used that way, because you can't define everything as a macro -- most of the constituent characters are associated with built-in behaviors that can't be defined as reader macros.