[plt-scheme] Current library collection paths and Check Syntax

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Apr 18 06:51:49 EDT 2007

At Wed, 18 Apr 2007 11:51:13 +0200, "jos koot" wrote:
> Hi,
> Consider:
> 
> Definitions window:
> (module runs-well-but-does-not-pass-syntax-check mzscheme
>  (begin-for-syntax
>   (current-library-collection-paths
>    (cons
>     "c:/scheme/kcollects"
>     (current-library-collection-paths))))
>  (require (lib "for.ss" "for")) ; from c:/scheme/kcollects/for/for.ss
>  (for ((i 1 3)) (printf "~s~n" i)))
> [...]
> May be I am doing a nasty thing

Definitely, yes. :)

You're right that Check Syntax and normal execution should be
consistent. My reaction is not to wonder why this doesn't work in Check
Syntax, but to try to figure out how to make it not work under any
circumstances.

Maybe this is a good example of why `current-library-collection-paths'
shouldn't be a parameter. Or maybe there should be a kind of
parameterization prompt around certain expressions, such as
`begin-for-syntax' and macro-transformer calls.

Anyway, the module system works when module names like `(lib "for.ss"
"for")' are treated as fixed points in the universal module namespace.
When you start shifting the universe around, lots of things will go
wrong. In this case, the universe shifts for expanding the module, but
Check Syntax still sees the unshifted universe, so it gets confused.

Matthew



Posted on the users mailing list.