From: Edward
Subject: CL:  Case Sensitivity
Date: 
Message-ID: <53897078-26e4-440e-bb0b-e7a3269ce258@l42g2000hsc.googlegroups.com>
Does anyone know if Common Lisp is ever to become case sensitive?  Why
or why not?  I'm curious because this is the only language I know,
and the only Lisp I know,  that is case insensitive.

From: Pascal J. Bourguignon
Subject: Re: CL:  Case Sensitivity
Date: 
Message-ID: <873ani8hpj.fsf@hubble.informatimago.com>
Edward <············@gmail.com> writes:

> Does anyone know if Common Lisp is ever to become case sensitive?  

Common Lisp IS case sensitive:


C/USER[51]> (EQ 'abc 'ABC)
NIL
C/USER[52]> (EQ 'Abc 'Abc)
T


> Why or why not?  

See reference below.


> I'm curious because this is the only language I know,
> and the only Lisp I know,  that is case insensitive.

You don't know enough programming languages.  There are a lot of
programming language that are NOT case sensitive.  Actually, AFAIK,
the majority of programming languages are not case sensitive. Common
Lisp, C and Modula-2 come to mind as the exceptions.

But the point is indeed that people are loosy at case sensitivity.
That's why it's good to have case insensitivity, for tokens input by
people.

Therefore Common Lisp has a parameter for the reader to automatically
upcase all the symbols, as they're read.  It's the READTABLE CASE.
To get the above effect, I set:

C/USER[50]> (setf (readtable-case *readtable*) :preserve)
:PRESERVE

By default, the setting is:

C/USER[53]> (SETF (READTABLE-CASE *READTABLE*) :UPCASE)
:UPCASE

So whatever the case you type, you get your symbols in upcase:

C/USER[54]> (list 'ABC 'abc  'Abc)
(ABC ABC ABC)

You can escape this upcasing:


C/USER[55]> (princ (list '|ABC| '|abc|  '|Abc|))
(ABC abc Abc)
(ABC |abc| |Abc|)
read
Note how PRINC prints the symbol without the escaping characters,
while PRINT does print them, when *PRINT-ESCAPE* is true, which is the
default.


But whatever the read-time behavior, Common Lisp is always case sensitive:

C/USER[56]> (|CL|:|EQ| (|CL|:|INTERN| "Abc") (|CL|:|INTERN| "ABC"))
NIL
C/USER[57]> (|CL|:|EQ| (|CL|:|INTERN| "Abc") (|CL|:|INTERN| "Abc"))
T



http://www.lispworks.com/documentation/HyperSpec/Body/f_rdtabl.htm

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

The world will now reboot.  don't bother saving your artefacts.
From: Tim Bradshaw
Subject: Re: CL: Case Sensitivity
Date: 
Message-ID: <384f4ad1-472f-47e8-9711-a278d0ee0248@y38g2000hsy.googlegroups.com>
On Jun 12, 9:56 pm, Edward <············@gmail.com> wrote:
> Does anyone know if Common Lisp is ever to become case sensitive?  Why
> or why not?  I'm curious because this is the only language I know,
> and the only Lisp I know,  that is case insensitive.

Common Lisp, as others have said, is case sensitive.  It just dresses
up in case insensitive clothing.

It's interesting that while the most widely used programming languages
are case sensitive, the most widely used filesystems are not: neither
Windows nor OS X have case sensitive filesystems, it's only various
(relatively) obscure and rare Unix filesystems which are case
sensitive in the traditional sense.  DNS is also not case sensitive.

One interesting characteristic which the default OS X FS has (and
which I think is shared with NTFS) is that they are case insensitive
but case preserving:

kingston$ touch StudlyCaps
kingston$ ls -l
total 0
-rw-r--r--  1 tfb  wheel  0 Jun 13 08:04 StudlyCaps
kingston$ ls -l studlycaps
-rw-r--r--  1 tfb  wheel  0 Jun 13 08:04 studlycaps
kingston$ rm studlycaps
kingston$ ls
kingston$

This, I suspect, is a useful compromise.
From: ······@corporate-world.lisp.de
Subject: Re: CL: Case Sensitivity
Date: 
Message-ID: <7a047c61-93af-495e-ba7a-846a4126de80@2g2000hsn.googlegroups.com>
On Jun 13, 9:06 am, Tim Bradshaw <··········@tfeb.org> wrote:
> On Jun 12, 9:56 pm, Edward <············@gmail.com> wrote:
>
> > Does anyone know if CommonLispis ever to become case sensitive?  Why
> > or why not?  I'm curious because this is the only language I know,
> > and the onlyLispI know,  that is case insensitive.
>
> CommonLisp, as others have said, is case sensitive.  It just dresses
> up in case insensitive clothing.
>
> It's interesting that while the most widely used programming languages
> are case sensitive, the most widely used filesystems are not: neither
> Windows nor OS X have case sensitive filesystems, it's only various
> (relatively) obscure and rare Unix filesystems which are case
> sensitive in the traditional sense.  DNS is also not case sensitive.
>
> One interesting characteristic which the default OS X FS has (and
> which I think is shared with NTFS) is that they are case insensitive
> but case preserving:
>
> kingston$ touch StudlyCaps
> kingston$ ls -l
> total 0
> -rw-r--r--  1 tfb  wheel  0 Jun 13 08:04 StudlyCaps
> kingston$ ls -l studlycaps
> -rw-r--r--  1 tfb  wheel  0 Jun 13 08:04 studlycaps
> kingston$ rm studlycaps
> kingston$ ls
> kingston$
>
> This, I suspect, is a useful compromise.


This is also how LMFS (the Lisp Machine File System) works.

Command: Create File RJNXP:>joswig>temp>BaR.text.newest
Creating RJNXP:>joswig>temp>BaR.text.newest (<End> writes, <Abort>
aborts):
Written: RJNXP:>joswig>temp>BaR.text.1

Command: Show Directory (files [default
RJNXP:>joswig>temp>*.*.newest]) RJNXP:>joswig>temp>bar.*.newest

RJNXP:>joswig>temp>bar.*.newest
  318088 free, 156902/474990 used (33%) (LMFS records, 1 = 5056. 8-bit
bytes)

      BaR.text.1       1      1(8)     !    #1 06/13/08 10:05:21
(06/13/08) joswig

1 block in 1 files

Command: Show Directory (files [default
RJNXP:>joswig>temp>*.*.newest]) RJNXP:>joswig>temp>bar.*.newest

RJNXP:>joswig>temp>bar.*.newest
  318088 free, 156902/474990 used (33%) (LMFS records, 1 = 5056. 8-bit
bytes)

      BaR.text.1       1      1(8)     !    #1 06/13/08 10:05:21
(06/13/08) joswig

1 block in 1 files