Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!gem.mps.ohio-state.edu!ginosko!uunet!mcsun!sunic!liuida!uda From: uda@majestix.ida.liu.se (Ulf Dahlen) Newsgroups: comp.lang.lisp Subject: Re: DeKleer's ATMS: the continuing saga Message-ID: <1338@majestix.ida.liu.se> Date: 29 Aug 89 17:43:23 GMT References: <19543@usc.edu> Organization: CIS Dept, Univ of Linkoping, Sweden Lines: 27 In article <19543@usc.edu> burke@pollux.usc.edu (Sean Burke) writes: > I have looked in vain in CLTL for a specification that format should use >the canonical print-name of a symbol, unless you count p304, "To get the string >representation of a number or any other Lisp object, use prin1-to-string, >princ-to-string, or format." The functions which are specified to return >a symbol's print-name, "symbol-name" and "string" get no mention. Hmmm. In CLtL page 387 the ~A directive to FORMAT is explained. It says the the argument is printed without escape characters, as by PRINC. (Compare ~S where the argument is printed as by prin1 instead.) So, you would expect (FORMAT nil "~A" 'foo) to return a string with FOO as printed by PRINC. Now, all printing functions are governed by a couple of variables, one of them beeing *PRINT-CASE*. If *PRINT-CASE* is :UPCASE symbols will be printed in upper-case, if it's :DOWNCASE symbols will be printed in lower-case. Binding *PRINT-CASE* to :UPCASE around the FORMAT should work. However, a better solution is (FORMAT nil "~A" (STRING 'FOO)) which will always give the internal print-name of FOO. __________ Ulf Dahlen Dept of Computer & Info Science, University of Linkoping, Sweden Troskaregatan 51:23 | uda@ida.liu.se S-583 30 LINKOPING | uda@majestix.liu.se, uda@liuida.UUCP SWEDEN | {mcvax,munnari,seismo}!enea!liuida!uda "The beginning is a very delicate time."