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

From: jos koot (jos.koot at telefonica.net)
Date: Wed Apr 18 07:58:09 EDT 2007

Matthew,
Thanks for a quick and clear answer.
I agree that the example should be refused under all circumstances.
Nevertheless, Check Syntax should not crash on it, I think.
Wrapping current-library-collection-paths within parameterization prompt, as you suggest, probably solves this problem.

My example stems from a more elaborate code that starts from (this-expression-source-directory) in order to find out in which 
root-directory the main module and its libraries are stored, thus making the code insensitive for the location of the 
root-directory. Now I am left with the question how to avoid absolute path names and yet allowing different versions in different 
root-directories without hardwiring a different root-directory in every version. A short hint would be much appreciated.
Greetings, Jos koot

----- Original Message ----- 
  From: Matthew Flatt
  To: jos koot
  Cc: PLT-list
  Sent: Wednesday, April 18, 2007 12:51 PM
  Subject: Re: [plt-scheme] Current library collection paths and Check Syntax


  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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070418/9f1810c4/attachment.html>

Posted on the users mailing list.