2

I want to define reader macros in such a way that they affect only a certain package/file.

So far I was able to load those files with

(let ((*readtable* (copy-readtable)))
  (load "file.lisp"))

Is there a better way to do it?

1 Answer 1

6

named-readtables is quite good to manipulate readtables.

EDIT:

You can look at Clesh and especially this commit to see how I've used named-readtables to define a new readtable. So now, instead of using (clesh:enable) to use the reader macros, one use (named-readtables:in-readtable clesh:syntax).

Sign up to request clarification or add additional context in comments.

2 Comments

How easy to use is it with slime and asdf?
@sabof: named-readtables is available through quicklisp thus you can (ql:quickload :named-readtables) and you're done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.