[asdf-devel] Make the CL syntax predictable

Faré fahree at gmail.com
Fri Mar 14 22:48:53 UTC 2014


On Fri, Mar 14, 2014 at 6:10 PM, Robert Goldman <rpgoldman at sift.net> wrote:
> Quick follow-up: what about blowing this discussion into launchpad under
> the rubric of "Manage CL syntax" or something like that.
>
> I would prefer not to lose the discussion.
>
> I believe this is a place where a tool like POIU or XCVB really veers
> away from vanilla CL usage.
>
> Vanilla CL usage encourages* actions during building that side-effect
> the global state of the image.  These actions may be bad if one wishes
> to build individual components in multiple different CL images.  But
> they are natural to people developing code incrementally and
> interactively using a REPL.
>
> I don't want ASDF to drift into being a tool that prescriptively moves
> people away from that practice.  I think that's too presumptive for a
> piece of infrastructure.  I don't think it's my job to wreck code, just
> because it's bad style.  And I don't think proper use of the readtable
> or of pretty-print dispatch is obvious enough that people will recover
> well if we mess with it.
>
> As you have said, I am inclined to be much more conservative about
> changes like this.
>
Here is my theory: safe code needs to respect hygiene, because you
never know which system are loaded before or after: it depends on the
overall plan of the toplevel target system. Therefore is it never
correct to rely on other systems having set a particular readtable,
and it is never correct to side-effect the current readtable into
something that modifies standard characters — or any character that
any other program might want to use, for the matter. If you
side-effect the readtable, and the readtable escapes, you are going to
hurt someone, somewhere.

In the current setup, it is therefore a bug if you side-effect the
readtable, and those programs that do are buggy. Using
named-readtables is fine, but only if you reset the readtable to the
standard one at the end of every file, or have a method that binds
*readtable* around your compilation.

I see two ways forward: (1) recognize that it is a bug, and help
programmers by being strict, modulo some compatibility mode for older
systems until they are fixed, or (2) slightly change the semantics so
that it's not a bug anymore, by making the readtable either per-file
or per-system; then you can modify the readtable to your heart's
content, because it's private.

My initial reaction was (1), and that's more or less the patch I sent
to anton, who tells us it breaks a lot of things. At Anton's
suggestion, I considered (2) and it looks promising — but we need to
modify the protocol and/or use a new method-combination to achieve the
effect in a backward compatible way.

—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
The only way to have a friend is to be one. — Ralph Waldo Emerson



More information about the asdf-devel mailing list