Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!farquhar From: farquhar@cs.utexas.edu (Adam Farquhar) Newsgroups: comp.lang.lisp Subject: Re: READ and upper/lower case symbol print names Summary: *print-case* may do it, but has a suprising characteristic Message-ID: <7390@cs.utexas.edu> Date: 19 Dec 89 16:32:06 GMT References: <23295@brunix.UUCP> Organization: U. Texas CS Dept., Austin, Texas Lines: 24 In article <23295@brunix.UUCP> mj@cs.brown.edu (Mark Johnson) writes: >Is there an easy way to modify the lisp READ function so that >it does not always convert lower case letters to upper case >in symbol names? The variable *print-case* may provide the functionality that you need. If *print-case* is set to :downcase, rather than it's default value of :upcase, all symbols will be printed out in lowercase. This only affects the printing, however, and does not alter the name of any symbols. As a colleague of mine, David Throop, recently pointed out to me, this may result in some suprising behavior when converting from strings to symbols. I.e. (setq *print-case* :downcase) => :downcase (setq x 'foo) => foo (string x) => "FOO" (format nil "~a" x) => "foo" (intern "foo") => |foo| thus (eq (intern "foo") x) => nil and (eq (intern "FOO") x) => t and (eq (intern (prin1-to-string 'foo)) 'foo) => nil This can give rise to some difficult to find bugs. I would tend to lowercase output with either string-downcase or (format t "~(~a~)"). Adam Farquhar.