[plt-scheme] Re: Standard module resolver issue

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Sat Jul 4 04:27:24 EDT 2009

On Sat, Jul 4, 2009 at 12:25 AM, YC<yinso.chen at gmail.com> wrote:
> what happens when you try to run it in REPL?  I tried it and except having
> to change the hardcoded path, it works.
>

What do you mean in the REPL? you mean mzscheme?
How did it work on yours? After compilation or in DrScheme? As I said,
the executable doesn't work and produces the error but indeed inside
DrScheme it works ok.

> 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 [email protected])")
>>        (fprintf fp "(define-unit [email protected] (import test^) (export)~n")
>>        (fprintf fp "(* x 2)")
>>        (fprintf fp ")"))); closes define-unit
>>    filename))
>>
>> (let* ([file (generate)]
>>       [[email protected] (dynamic-require file '[email protected])]
>>       [x 5]
>>       [result (invoke-unit [email protected] (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
>
>



-- 
Paulo Jorge Matos - pocmatos at gmail.com
http://www.pmatos.net


Posted on the users mailing list.