[plt-scheme] Trouble with MrEd. Designer compilation

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Aug 20 01:10:52 EDT 2006

At Fri, 18 Aug 2006 14:09:47 +0200 (CEST), Ivanyi Peter wrote:
> However there is something wrong with load/use-compiled 
> and modules together. The loaded code cannot "see" the provided
> functions. I do not know how to fix this.

The problem is that a module import is more like a syntax definition
than a top-level variable definition. For example:

  (define (cons x y) 12)
  (define (f) (cons 1 2)) ; refers to the "cons" variable
  (require mzscheme)
  (cons 1 2) ; => '(1 . 2), since "cons" now accesses an import
  (f) ; => 12, since f still refers to the "cons" variable

So, if you compile with a different set of imports than when you run,
the behavior can be different than when you run from source.

Whether it's module imports or macro definitions, this sort of
confusion is a big part of why the top level is hopeless.

> Later on, everything will be a module, so we will not have
> this problem.

Right - modules will certainly avoid the confusion.

Matthew



Posted on the users mailing list.