[plt-scheme] Case Sensitivity With Macros in Modules.

From: Ray Racine (rracine at adelphia.net)
Date: Sun Jul 7 00:27:15 EDT 2002

I am seeing symbols being converted to all lower case when used in
macros inside a module.

(module sym mzscheme
  (provide (all-defined))
  
  (define-syntax print-symbols
    (syntax-rules ()
                  ((_ s1 s2)
                   (display (string-append 
                             "S1: " 
                             (symbol->string 's1)
                             " S2: "
                             (symbol->string 's2) 
                             "\n")))))
  
  (define-syntax sym->string
    (syntax-rules ()
                  ((_ sym)
                   (print-symbols sym Bar)))))

> (require (file "/src/scheme/cyc/sym.scm"))
> (sym->string Foo)
S1: Foo S2: bar

Notice Bar printed as bar.

However if I define the macros at the top-level REPL instead of inside a
module I see:

> (sym->string Foo)
S1: Foo S2: Bar

Now Bar prints as Bar, which is what I would like to happen.  Why is the
symbol Bar lowercased when used by a macro in a module??

I am using Graphical (MrEd, includes MzScheme) with the Case sensitive
option checked.  

I am using the term symbol here casually as they are not
defined/interned symbols but more of a literial expression.
(quote <datum>).

Thanks,

Ray Racine





Posted on the users mailing list.