[plt-scheme] Re: Standard module resolver issue

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Sat Jul 4 07:09:28 EDT 2009

On Sat, Jul 4, 2009 at 10:58 AM, Hugh Myers<hsmyers at gmail.com> wrote:
> In the REPL would be in your terms, 'inside DrScheme'.
>


Could also mean in the terminal through mzscheme... which by the way,
also works, so I guess the problem is only with the compiled version.

In my example:
sorgematos at sorgematos-laptop:~/Temp$ mzscheme
Welcome to MzScheme v4.2 [3m], Copyright (c) 2004-2009 PLT Scheme Inc.
> (require "gen.scm")
Result: 10

> --hsm
>
> On Sat, Jul 4, 2009 at 2:27 AM, Paulo J. Matos<pocmatos at gmail.com> wrote:
>> 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 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
>>>
>>>
>>
>>
>>
>> --
>> 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.