[asdf-devel] Make the CL syntax predictable

Attila Lendvai attila.lendvai at gmail.com
Sun Mar 16 06:22:11 UTC 2014


> The clean thing to do would be to use named-readtables and/or
> cl-syntax, and have each file evaluate (in-readtable :foo) or have a
> perform :around method or around-compile hook that does it for you.

[...]

> Without ASDF, there's no way the libraries will be safe by default.

well, there is, but it's not trivial, so most will not take the extra
effort required:

FTR, from hu.dwim.common we ended up shadowing cl:in-package in all
our projects and added an internal mapping from package to
readtable-setup-function (using a custom package definer that knows
about readtables).

our hu.dwim.common:in-package also sets the readtable and expects that
our hu.dwim.asdf systems rebinds a copy of *readtabe* around compiling
and loading.

in a hu.dwim.common+swank integration system (or in one of those...)
Slime is also notified about the readtables, so C-c C-c works as
expected.

i'd be happy if all this web of complexity could move out of our repos
and into the environment, where it simultaneously becomes much simpler
also.

in short, i agree with Fare on this.


> But polluting arbitrary systems loaded after you is definitely a bad
> idea:


yes, projects sideffecting *readtable* was annoying me quite a lot,
and i've sent around my set of patches to a few projects that did
that, including none other than iterate itself.


> based on a general-purpose "each system has a set of private
> variables" protocol.


i don't have a strong opinion on this, but after some consideration we
went with another protocol that is based on functions that modify a
readtable that is given to them, which is much more flexible. not
sure/don't remember whether this extra flexibility was actually
needed, though. maybe it was needed for some combination of multiple
syntaxes set up at the same time...

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“The Atheist does not say "there is no god", but he says "I do not
know what you mean by god; I am without the idea of god; the word god
is to me a sound conveying no clear or distinct affirmation. I do not
deny god, because I cannot deny that of which I have no conception and
the conception of which by its affirmer is so imperfect that he is
unable to define it to me.”
	— Charles Bradlaugh  (1833–1891), 'National Review' (1883–11–25)



More information about the asdf-devel mailing list