home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!agate!anarres.CS.Berkeley.EDU!bh
- From: bh@anarres.CS.Berkeley.EDU (Brian Harvey)
- Newsgroups: comp.lang.scheme
- Subject: Re: case sensitivity
- Date: 6 Nov 1992 16:00:49 GMT
- Organization: University of California, Berkeley
- Lines: 45
- Distribution: world
- Message-ID: <1de4rhINNn4u@agate.berkeley.edu>
- References: <1992Nov6.062357.8865@Informatik.TU-Muenchen.DE>
- NNTP-Posting-Host: anarres.cs.berkeley.edu
-
- kobler@informatik.tu-muenchen.de (Daniel Kobler) writes:
- > 'Wall is claimed to be the same as 'WALL,
- >
- >whereas
- >
- > (string->symbol "Wall") and (string->symbol "WALL") are different.
- >
- >And again my question: why these differences? Wouldn't it be better to
- >do it the one OR the other way, i.e. allow symbols with upper/lower
- >case letters or strictly converting all letters inside symbol names to
- >the case preferred by the respective implementation?
-
- It *would* be nice, I think, if someone more qualified than I wrote a
- summary article called "The Philosophy of Scheme" or something like that
- explaining how things like this come about.
-
- But, ever foolhardy, I'll throw in my partial understanding...
-
- One traditional Lisp idea that has been pretty thoroughly rejected in
- Scheme is that of programs constructing programs and then evaluating
- them. If you're accustomed to manipulating program text as data (as
- opposed to manipulating executable bits of program -- functions -- as
- data, which Scheme *does* support) then along with that you're accustomed
- to thinking of a symbol as a kind of text string. Traditional Lisp
- systems support this way of thinking by providing things like EXPLODE
- and IMPLODE that encourage messing around with the characters in a symbol.
-
- On the Scheme view, a symbol is a seamless black box. It's just as a
- concession to human memory that symbols have letters in them at all;
- from Scheme's point of view it would be just as good if you had a keyboard
- with a few hundred unlabelled keys, each of which was a single-keystroke
- symbol.
-
- string->symbol is a concession to people with unusual needs. The reason
- it doesn't follow the usual rules for symbols is that it exists precisely
- as a mechanism to escape from those rules. Using string->symbol is
- cheating, sort of like using goto in some other languages.
-
-
- (P.S. If this doesn't come out quite right it's because I'm trying to
- express a view that isn't mine. Personally I find that I spend far too
- much time putzing with details about characters vs. strings vs. symbols;
- for my simple mind the Logo approach in which there is just one data type
- called Word that fills all these roles is easier. But of course it's
- less efficient the Logo way.)
-