Re: Question named-readtables
Steve Haflich <[email protected]> Thu, 31 Jan 2008 19:18:29 -0800
| Newsgroups | gmane.lisp.allegro |
|---|---|
| Message-ID | <[email protected]> |
From: Luis Oliveira <[email protected]> I have a quick question about Allegro's named-readtable facility. What is the rationale for restricting the names to keywords? It seems to me that using symbols would help avoid naming conflicts between similarly named readtables from multiple codebases. I'm the one who implemented Allegro's named-readtable facility back around 1991. I can't necessarily remember all the thinking behind it, but I though that I copied the basic concept from Symbolics. However, yesterday when I was in the office I checked a full set of Genera documentation and could find nothing at all documenting named readtables. Can anyone suggest where the idea might have come from? Anyway, you are correct that allowing arbitrary symbols to be used as readtable names would reduce the possibility of collision, but no application ever uses more than a few readtables so the probability of collision in practice is essentially zero. I believe at the time I wanted to make sure there would be no package problems with the tools like the Emacs-Lisp interface and the Allegro IDE (which will communicate the readtable name when evaluating/compiling from a source buffer) trying to communicate a readtable name with a package that doesn't yet exist. The package of a readtable name not yet existing would be a different error circumstance than the named readtable not yet being defined, so it simplifies these tool interfaces to restrict the names to the keyword package. Also, coercing to keywords means that an Emacs variables line can look like this ;; -*- mode: common-lisp; package: user; readtable: xml -*- instead of like this ;; -*- mode: common-lisp; package: user; readtable: :xml -*- Do you really think that the collision possibility is an important issue here? The mode line examples above show that changing the package handling would not easily be back compatible.