[plt-scheme] On PLaneT packages and compatible upgrades

From: Richard Cobbe (cobbe at ccs.neu.edu)
Date: Thu May 11 14:02:10 EDT 2006

On Tue, May 09, 2006 at 05:10:02PM -0500, Robby Findler wrote:
> Another possibility: we could force each import to have its own
> (unique) prefix when imported into a module. In addition to avoiding
> this problem, it seems like it could even help make people's programs
> more readable, since imports would be identified at a glance.

I just started trying this out, and I noticed an unfortunate consequence
of this pattern: it breaks at least two editors' logic for automatic
indentation and keyword highlighting:

(module foo mzscheme

  (require (lib "plt-match.ss"))
  (define x
    (match 3                ;; match highlighted as keyword
      ((list x y z) y)
      (x (+ x 1)))))


(module foo mzscheme
  (require (prefix m: (lib "plt-match.ss")))
  (define x
    (m:match 3              ;; m:match rendered as normal identifier
             ((list x y z) y)
             (x (+ x 1)))))

I got similar results in DrScheme and in XEmacs+quack.

Also, by "keyword highlighting" in DrScheme, I'm referring to Scott's
as-you-type syntax highlighting, not to the coloring done by check
syntax.  Check syntax does the right thing for both modules above.

Just another fun result of using a language with powerful macros.

How significant this is depends on the individual programmer: how
important are this kind of syntax highlighting and automatic indentation
to you?  (Speaking personally, I can live without highlighting, but no
indentation would be really frustrating.)


Posted on the users mailing list.