[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Case sensitivity in modules?



It surprises me that -g doesn't work, especially since this does:

[1]ptg$ mzscheme -g
Welcome to MzScheme version 200alpha14, Copyright (c) 1995-2002 PLT
Identifiers and symbols are initially case-sensitive.
> (module modtest mzscheme
  (provide foo bar)
  (define foo (lambda () (equal? 'hello 'hello)))
  (define bar (lambda () (equal? 'hello 'Hello)))
)
> (require modtest)
> (foo)
#t
> (bar)
#f


Perhaps you can't rely on -g for making program text case sensitive since
it may be compile to bytecode without -g, though it doesn't seem like the
case here.

It's probably better to use #cs(module modtest ...) for a case sensitive
module anyway since the module author knows better if it should be case
sensitive or not.

Paul
> 
> 
> Hello,
> 
> 	Why was Scheme made case insensitive in the first place?
> 
> I have a module
> 
> (module modtest mzscheme
>   (provide foo bar)
>   (define foo (lambda () (equal? 'hello 'hello)))
>   (define bar (lambda () (equal? 'hello 'Hello)))
> )
> 
> I expect (foo) -> #t and (bar) -> #f when running with case sensitivity
> on.
> 
> So, I fire up MzScheme (200a12) with 'mzscheme -g'
> 
> Welcome to MzScheme version 200alpha12, Copyright (c) 1995-2002 PLT
> Identifiers and symbols are initially case-sensitive.
> > (equal? 'hello 'Hello)
> #f
> > (require "modtest.ss")
> > (foo)
> #t
> > (bar)
> #t
> > (equal? 'hello 'Hello)
> #f
> 
> 	Putting a (read-case-sensitive #t) in the module doesn't seem to
> convince it that I want it to be case sensitive. I have read of the PLT
> Language Manual concerning modules (5.8) and am at a loss as to how to
> cajole my module into being a more sensitive partner in my programming.
> 
> 	Help?
> 
> 	Thanks,
> 	Matt
> ________________________________________________________________________
> Matt Jadud                            http://www.cs.indiana.edu/~mjadud/
> Current Temperature Outside Lindley Hall                 50.4 F / 10.2 C
> Canterbury Weather: High 50 F / 10 C, Low 46 F / 8 C, Light rain
>