[plt-scheme] Re: Standard module resolver issue
what happens when you try to run it in REPL? I tried it and except having
to change the hardcoded path, it works.
On Fri, Jul 3, 2009 at 4:01 PM, Paulo J. Matos <pocmatos at gmail.com> wrote:
> I managed to create a small example depicting what's happening:
> test-sig.scm:
> #lang scheme
>
> (define-signature test^
> (x))
>
> (provide test^)
> ================== END
>
>
> gen.scm:
> #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
> filename))
>
> (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?
>
> Cheers,
>
> --
> Paulo Jorge Matos - pocmatos at gmail.com
> http://www.pmatos.net
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090703/6b6a36fa/attachment.html>