Re: minor bug in pprinting (with fix)
Gary Byers <[email protected]> Sun, 14 Sep 2003 09:11:58 -0600 (MDT)
| Newsgroups | gmane.lisp.openmcl.bugs |
|---|---|
| Message-ID | <[email protected]> |
On Sat, 13 Sep 2003, George Ferguson wrote: > Hi openmcl people. OpenMCL 0.13.6 on OSX 10.2.6. Great package! > Thanks for the bug report, but ... I'm confused. > Had a strange error popping up when trying to PPRINT some big lists. > Eventually tracked down to code in lib/format.lisp that handled the > ~/...~/ directive (evaluate function). When no package was given as > part of the symbol in the directive, the default being used was > `:cl-user'. This doesn't exist in openmcl, but changing it to `:user' > worked fine. Patch appended. The CL-USER package certainly does exist in OpenMCL; under ordinary circumstances, the USER package should not. In the early days of CL, the default package was named "USER"; ANSI CL changed the name to "COMMON-LISP-USER", with the somewhat shorted nickname "CL-USER". So: Welcome to OpenMCL Version (Beta: Darwin) 0.13.6! ? (find-package :cl-user) #<Package "COMMON-LISP-USER"> ? (find-package :user) NIL ? > > Please note that it's not like I would actually USE something as > obscure as the ~/ directive, although I would staunchly defend the > right of pretty-printers to use it, which it appears they do. > > Note also that there is a handler for ~/ defined in lib/pprint.lisp, > but that code is apparently not the code in question. And, by the way, > it defaults to "USER", so should be ok if it is used. The version of the FORMATTER directive in the pprint source file (and the DEF-FORMAT-HANDLER for ~/) are conditionalized out (they're inside a large EVAL-WHEN that's #-:CCL-2 . > > Hope this helps, > George > ps. I don't subscribe to this mailing list and there is no web archive, > so please respond to me in person if need be. The web archive's at: <http://www.clozure.com/pipermail/bug-openmcl/> The "message from non-subscriber held for approval" is arguably better rhan allowing spam to be posted. > -- > Dr. George Ferguson Research Scientist > Dept. of Computer Science NET: ferguson at cs dot rochester dot edu > University of Rochester WWW: > http://www.cs.rochester.edu/~ferguson/ > Rochester NY 14627-0226 TEL: (585) 275-5766 FAX: (585) 273-4556 > Thanks for the bug report and the patch, but if the USER package exists in your environment and the CL-USER package doesn't, it sounds like something else is going wrong elsewhere. There is some old code that'll offer some restarts if one tries to use packages named "USER" or "LISP": ? (in-package "USER") > Error: There is no package named "USER" . > While executing: SET-PACKAGE > Type :GO to continue, :POP to abort. > If continued: Retry finding package with name "USER". Type :? for other options. 1 > :r 0. Return to break level 1. 1. #<RESTART ABORT-BREAK #x9EB76> 2. Retry finding package with name "USER". 3. Find specified package instead of "USER" . 4. Make "USER" be a nickname for package "CL-USER". 5. (require :lisp-package) and retry finding package "USER" 6. Return to toplevel. 7. #<RESTART ABORT-BREAK #x9EF56> 1 > Restart #5 above will try to set things up so that packages named "LISP" and "USER" exist, with some of the same functionality that they had in early versions of CL. None of the restarts above will affect the COMMON-LISP-USER or COMMON-LISP packages.