[plt-scheme] Re: Standard module resolver issue

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Fri Jul 3 19:01:38 EDT 2009

I managed to create a small example depicting what's happening:
#lang scheme

(define-signature test^

(provide test^)
================== END

#lang scheme

(require "test-sig.scm")

(define (generate)
  (let ([filename (make-temporary-file)])
    (call-with-output-file filename
      #:mode 'text
      #:exists 'replace
      (lambda (fp)
        (fprintf fp "#lang scheme~n~n")
        (fprintf fp "(require (file \"/home/sorgematos/Temp/test-sig.scm\"))")
        (fprintf fp "(provide test@)")
        (fprintf fp "(define-unit test@ (import test^) (export)~n")
        (fprintf fp "(* x 2)")
        (fprintf fp ")"))); closes define-unit

(let* ([file (generate)]
       [test@ (dynamic-require file 'test@)]
       [x 5]
       [result (invoke-unit test@ (import test^))])
  (printf "Result: ~a~n" result))

================== END

They are in the same directory: /home/sorgematos/Temp/

Now, running gen.scm inside DrScheme works perfectly and prints :
Result: 10

However, in the terminal with PLT Scheme 4.2 I get the following interaction:
sorgematos at sorgematos-laptop:~/Temp$ mzc --exe gen gen.scm
sorgematos at sorgematos-laptop:~/Temp$ ./gen
standard-module-name-resolver: collection not found:
#<path:scheme/lang> in any of: (#<path:/home/sorgematos/collects>)
sorgematos at sorgematos-laptop:~/Temp$ ln -s
/usr/local/lib/plt/collects/ ../collects
sorgematos at sorgematos-laptop:~/Temp$ ./gen
define-compound-unit: unit argument expects an untagged import with
signature test^, which this usage context does not supply

 === context ===
/usr/local/lib/plt/collects/mzlib/private/unit-runtime.ss:66:4: loop
/usr/local/lib/plt/collects/mzlib/private/unit-runtime.ss:132:2: check-sigs

Any suggestions or comments on this?


Paulo Jorge Matos - pocmatos at gmail.com

Posted on the users mailing list.