This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Case-sensitivity.


>>>>> "Graham" == Graham Hughes <ghughes@cs.ucsb.edu> writes:

Graham> This [scsh] and XML parsing [0] are the only good reasons I
Graham> can come up with off the top of my head for true case
Graham> sensitivity (although I sympathize with Per in Kawa).

There is also CMIP, OSIs network management protocol, which is (apart
from very complex) object oriented with case sensitive identifiers.

I hope not that anybody thinks that we could anything but change the
default and/or make the scheme more flexible. 

Case sensitivity has many good uses when trying to mirror various
concepts from the "real world" within scheme. After all this is one of
the things that lisp with its extremely flexible identifier/symbol
concept do so well. No amount of fancy syntax will ever be able to
make up for a permanent loss of the possibility of having case
sensitive readers.


Graham> Since Common Lisp folds case, to get <Foo/> you need to do
Graham> (|Foo|).

Have you tried messing with `readtable-case' (the common lisp reader
is a rather advanced tool). From the hyperspec:

------------------------------------------------------------------------------

    23.1.2.1 Examples of Effect of Readtable Case on the Lisp Reader


     (defun test-readtable-case-reading ()
       (let ((*readtable* (copy-readtable nil)))
	 (format t "READTABLE-CASE  Input   Symbol-name~
		  ~%-----------------------------------~
		  ~%")
	 (dolist (readtable-case '(:upcase :downcase :preserve :invert))
	   (setf (readtable-case *readtable*) readtable-case)
	   (dolist (input '("ZEBRA" "Zebra" "zebra"))
	     (format t "~&:~A~16T~A~24T~A"
		     (string-upcase readtable-case)
		     input
		     (symbol-name (read-from-string input)))))))

    The output from (test-readtable-case-reading) should be as follows:


     READTABLE-CASE     Input Symbol-name
     -------------------------------------
	:UPCASE         ZEBRA   ZEBRA
	:UPCASE         Zebra   ZEBRA
	:UPCASE         zebra   ZEBRA
	:DOWNCASE       ZEBRA   zebra
	:DOWNCASE       Zebra   zebra
	:DOWNCASE       zebra   zebra
	:PRESERVE       ZEBRA   ZEBRA
	:PRESERVE       Zebra   Zebra
	:PRESERVE       zebra   zebra
	:INVERT         ZEBRA   zebra
	:INVERT         Zebra   Zebra
	:INVERT         zebra   ZEBRA


------------------------------------------------------------------------------

[Starting Points][Contents][Index][Symbols][Glossary][Issues]
Copyright 1996, The Harlequin Group Limited. All Rights Reserved.


---------------------------+--------------------------------------------------
Christian Lynbech          | Telebit Communications A/S                       
Fax:   +45 8628 8186       | Fabrik 11, DK-8260 Viby J
Phone: +45 8628 8177 + 28  | email: chl@tbit.dk --- URL: http://www.telebit.dk
---------------------------+--------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - petonic@hal.com (Michael A. Petonic)