[plt-scheme] string->symbol and case

From: Robby Findler (robby at cs.uchicago.edu)
Date: Fri May 16 18:44:33 EDT 2003

Case in-sensitivity in DrScheme is implemented by the read primtive
(the same one that parses your code) automatically down-casing symbols
it encounters. So, when you submit:

  (define AA 'hi)

to the REPL, this is translated to:

  (define aa 'hi)

by read (the parser). The parser's behavior can be customized in the
language dialog, or with the read-case-sensitive parameter, or by #ci:

  #cs(define AA 'hi)

means what you seem to want, ie it will define the uppercase AA, not
the lowercase one.

string->symbol, on the other hand, does not do this implicit
downcasing.

hth,
Robby

At Sat, 17 May 2003 00:39:10 +0200, Vincent Hourdin wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> Hi,
> I'm trying to eval symbols that I get with (string->symbol str) :
> 
> > (define AA 'hi)
> > (string->symbol "AA")
> |AA|
> 
> so...
> > (eval (string->symbol "AA"))
> reference to undefined identifier: AA
> 
> It seems that eval doesnt removes quoting vertical bars so I cant run it.
> Is this a case insensitive problem ? How can I make my capital letters string 
> eval the same name function ?
> Thanks
> 
> 



Posted on the users mailing list.