minor bug in pprinting (with fix)

George Ferguson <[email protected]> Sat, 13 Sep 2003 19:34:21 -0400
Newsgroups gmane.lisp.openmcl.bugs
Message-ID <[email protected]>
Hi openmcl people. OpenMCL 0.13.6 on OSX 10.2.6. Great package!

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.

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.

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.
-- 
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

---cut---
*** format.lisp.~1.5.~	Tue Apr  1 19:06:50 2003
--- format.lisp	Sat Sep 13 19:19:28 2003
***************
*** 459,465 ****
                (when (eql #\: (schar string (%i+ 1 cpos)))
                  (setq cpos (%i+ cpos 1)))
                (setq ipos (%i+ cpos 1)))
!             (t (setq package :cl-user)))
         (let ((thing (intern (string-upcase (%substr string ipos epos)) 
(find-package package))))
           (setq *format-index* epos) ; or 1+ epos?
           (apply thing stream (pop-format-arg) colon atsign parms)))))
--- 459,465 ----
                (when (eql #\: (schar string (%i+ 1 cpos)))
                  (setq cpos (%i+ cpos 1)))
                (setq ipos (%i+ cpos 1)))
!             (t (setq package :user)))
         (let ((thing (intern (string-upcase (%substr string ipos epos)) 
(find-package package))))
           (setq *format-index* epos) ; or 1+ epos?
           (apply thing stream (pop-format-arg) colon atsign parms)))))