Re: #;



Tobias C. Rittweiler wrote:
Pascal Costanza <pc@xxxxxxxxx> writes:

The better solution is to add something like #; and in principle, this
is possible via readtables hackery. However, the fact that #; doesn't
get more widely used (like, say, with-gensyms or other similarly
simple extensions) could be understood as a sign that readtables
hackery doesn't really work that well.

Indeed. Another reason is lack of proper readtable support in nowadays
Lisp environments.

To remedy both points, Robert Goldman and me hacked up a portable
library for named readtables. I.e. a way to register readtables very
analogously to how the package namespace works.

So in future every Lisp file should start with

(in-package :foo)
(in-readtable :standard)

And you can define new named readtables via DEFREADTABLE, i.e.

(defreadtable :foo
(:use :standard :quux)
(:macro-char #\$ #'dollar-reader))

And then you can use

(in-package :foo)
(in-readtable :foo)

Furthermore, you'll be able to use emacs-style file variables

-*- Package: :foo, Readtable: :foo -*-

and your environment will hopefully do the right thing.

There's a match for pretty much all FOO-PACKAGE or PACKAGE-FOO functions
in the CL spec. The code is already there, and pretty polished.

Additionally, the code already hooks into Franz's named-readtable
support, so it's already fully operational with ELI (and probably the
Franz's IDE as well.) I'll hack SLIME to support it the comming spring.
Hopefully, other Lisp environments will follow once it's in more
widespread use.

I don't know if the code is anonymously available yet, though. If it is,
I'll post a link; if not, you'll have to wait until I have time to set
up a project at common-lisp.net (which will probably be at the time I'll
hack its support into SLIME.)

This sounds very promising! I'm looking forward to this...


Pascal

--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
.



Relevant Pages

  • Re: #;
    ... is possible via readtables hackery. ... Another reason is lack of proper readtable support in nowadays ... other Lisp environments will follow once it's in more ...
    (comp.lang.lisp)
  • Re: symbol name with case preserved
    ... > CLISP, GCL, etc.) support a way to get the name of a symbol with it's case ... > Although Common Lisp is a case-insensative language, ... Check out the section on readtables in the HyperSpec, ... Tyler: "How's that working out for you?" ...
    (comp.lang.lisp)