libera/commonlisp - IRC Chatlog
Search
5:53:30
nij-
For example, after I `(ql:quickload :rutils) (in-package :rtl-user) (named-readtables:in-readtable rutils-readtable)`,
6:05:22
beach
Functions like COMPILE-FILE and LOAD bind *READTABLE*, so during compilation or loading, even if you alter the readtable, its old value is restored after compilation or loading.
6:06:32
beach
And, no, there is no mechanism to change the readtable according to the current package. There are two different variables: *PACKAGE* and *READTABLE*.
6:10:31
nij-
I see. Yeah after playing it more, I almost came to the conclusion that it's not meant to be used interactively.
6:12:10
nij-
I just add (setq *readtable* my-readtable) in the beginning of the file, and (setq *readtable* *old-readtable*) in the end of the file?
6:13:02
beach
You don't have to set it back. Like I said, COMPILE-FILE and LOAD do (LET ((*READTABLE* *READTABLE*)) ...) around the reading of your file.
6:14:54
nij-
beach, sorry, do you mean (let ((*readtable* *my-readtable*)) <insert the codes in the file>)?
6:16:01
beach
Check this example: (defparameter *x* 10) then (let ((*x* *x*)) (setf *x* 20)) then *x*
6:16:48
beach
That is what COMPILE-FILE and LOAD do, so you can safely assign to *READTABLE* in the file.
6:17:50
nij-
so do you mean (let ((*readtable* *readtable*)) (mutate *readtable*) <insert the codes in the file>)?
6:19:08
nij-
I use asdf without touching compile-file and load. But lemme do a quick experiment. Thanks :D
6:19:10
beach
Therefore, it is safe to assign to *READTABLE* in the file, just like you do (IN-PACKAGE...) in the beginning of the file.
10:14:01
minion
Josh_2: please look at universal greeting time: It is always morning when a person enters a channel, and late night when they leave. You may want to read http://www.total-knowledge.com/~ilya/mips/ugt.html for further information
12:16:26
Equill
Good point with the cake analogy: maybe what this thing needs is some brandy. I mean, what's the worst that can happen?
12:18:54
hayley
"By now, my remaining readers are wondering what I’ve been smoking. Well, I don’t smoke, but red wine is good for you."
12:18:55
Equill
Oh man, I've had that moment. Reading through some old code and thinking "was I *drunk* when I wrote thi... oh crap, now I remember. Yes, I was."