On 2/20/13 Feb 20 -2:44 PM, Faré wrote:
Dear Common Lisp hackers,
Inspecting with Anton Vodonosov the latest batch of cl-test-grid issues when running with asdf 2.29.x, we found an interesting case that mirrors the previous failure of iolib 0.7.3 with 2.29.
In the hope of making the semantics of asd files more deterministic, with an eye on eventually making .asd files a strict subset of Lisp, I had put in 2.27 a with-standard-io-syntax around the loading of a .asd file. However, this is specified to bind *readtable* and *print-pprint-dispatch* to standard tables that are notionally read-only, though this immutability is NOT enforced on most implementations, instead there being unspecified bad consequences if you do mutate.
So, I could conceivably (copy-readtable nil) and (copy-pprint-dispatch nil) every time, but that could be expensive on some implementations. Or I could say "it's the programmer's responsibility to ensure a proper table has been setup before he modifies it", but that would be harsh and a notable backward incompatibility (and there's no equivalent of named-readtables for pprint-dispatch). Or I could preserve the current semantics of a global table that everyone modifies causing "interesting" issues, by rebinding *print-pprint-dispatch* as well as *readtable* within the w-s-i-s, only ensuring that the other syntax variables are standard. Or I could remove the with-standard-io-syntax altogether, and say "yes, if you're doing any global modification, you suck and you're going to break something for someone, but that's none of my business".
Anton leans for the latter.
I favor the expensive option that keeps safety (copying) and that provides a predictable environment.
We don't load ASDF system definitions into COMMON-LISP-USER, or "whatever *PACKAGE* happens to be bound to" and we shouldn't do the equivalent for *readtable* or *print-pprint-dispatch*.
Doing something nasty to *READTABLE* while loading your ASDF system *should* break, IMO.
Libraries that want to do this should export functions that modify readtables and pprint-dispatch tables.
[I'm especially unsympathetic to this because of just this month having gone through hell fixing code that broke because a library felt like it could call SET-DISPATCH-MACRO-CHARACTER without specifying the readtable....]
Cheers, r