what happens when you try to run it in REPL? I tried it and except having to change the hardcoded path, it works.<br><br><div class="gmail_quote">On Fri, Jul 3, 2009 at 4:01 PM, Paulo J. Matos <span dir="ltr"><<a href="mailto:pocmatos@gmail.com">pocmatos@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I managed to create a small example depicting what's happening:<br>
test-sig.scm:<br>
#lang scheme<br>
<br>
(define-signature test^<br>
(x))<br>
<br>
(provide test^)<br>
================== END<br>
<br>
<br>
gen.scm:<br>
#lang scheme<br>
<br>
(require "test-sig.scm")<br>
<br>
(define (generate)<br>
(let ([filename (make-temporary-file)])<br>
(call-with-output-file filename<br>
#:mode 'text<br>
#:exists 'replace<br>
(lambda (fp)<br>
(fprintf fp "#lang scheme~n~n")<br>
(fprintf fp "(require (file \"/home/sorgematos/Temp/test-sig.scm\"))")<br>
(fprintf fp "(provide test@)")<br>
(fprintf fp "(define-unit test@ (import test^) (export)~n")<br>
(fprintf fp "(* x 2)")<br>
(fprintf fp ")"))); closes define-unit<br>
filename))<br>
<br>
(let* ([file (generate)]<br>
[test@ (dynamic-require file 'test@)]<br>
[x 5]<br>
[result (invoke-unit test@ (import test^))])<br>
(printf "Result: ~a~n" result))<br>
<br>
================== END<br>
<br>
They are in the same directory: /home/sorgematos/Temp/<br>
<br>
Now, running gen.scm inside DrScheme works perfectly and prints :<br>
Result: 10<br>
<br>
However, in the terminal with PLT Scheme 4.2 I get the following interaction:<br>
sorgematos@sorgematos-laptop:~/Temp$ mzc --exe gen gen.scm<br>
sorgematos@sorgematos-laptop:~/Temp$ ./gen<br>
<div class="im">standard-module-name-resolver: collection not found:<br>
</div>#<path:scheme/lang> in any of: (#<path:/home/sorgematos/collects>)<br>
sorgematos@sorgematos-laptop:~/Temp$ ln -s<br>
/usr/local/lib/plt/collects/ ../collects<br>
sorgematos@sorgematos-laptop:~/Temp$ ./gen<br>
<div class="im">define-compound-unit: unit argument expects an untagged import with<br>
</div>signature test^, which this usage context does not supply<br>
<div class="im"><br>
=== context ===<br>
/usr/local/lib/plt/collects/mzlib/private/unit-runtime.ss:66:4: loop<br>
/usr/local/lib/plt/collects/mzlib/private/unit-runtime.ss:132:2: check-sigs<br>
<br>
<br>
<br>
</div>Any suggestions or comments on this?<br>
<div class="im"><br>
Cheers,<br>
<br>
--<br>
Paulo Jorge Matos - pocmatos at <a href="http://gmail.com" target="_blank">gmail.com</a><br>
<a href="http://www.pmatos.net" target="_blank">http://www.pmatos.net</a><br>
</div><div><div></div><div class="h5">_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>
</div></div></blockquote></div><br>