[racket] GUI, places, exe

From: Roman Klochkov (kalimehtar at mail.ru)
Date: Sat Feb 15 09:33:16 EST 2014

 test.rkt
-----
#lang racket/gui

(define (main)
  (define p
    (dynamic-place "test-place.rkt" 'worker))
  (place-channel-put p 1)
  (place-channel-get p))

(main)

test-place.rkt
-----
#lang racket/base
(require racket/place)
(provide worker)

(define (worker ch)
  (define in (place-channel-get ch))
  (place-channel-put ch (+ in 1)))

----
Run test.rkt in DrRacket. OK. Gives 2.

Create excutable / Distribution. Got test.zip. Unpack it to C:\test. Run
Fail. Gives

default-load-handler: cannot open module file
  module path: #<path:C:\test\test-place.rkt>
  path: C:\test\test-place.rkt
  system error: File not found; errno=2
  context...:
   standard-module-name-resolver


Суббота, 15 февраля 2014, 6:55 -07:00 от Matthew Flatt <mflatt at cs.utah.edu>:
>At Sat, 15 Feb 2014 16:14:51 +0400, Roman Klochkov wrote:
>>  When I try to use places with racket/gui in one file, it gives me a error, 
>> because of double gui initialization.
>> 
>> When I use places in separate file via dynamic-place, it works, until I make 
>> an executable.
>> Then the executable requests all sources for my place.rkt, uncluding all 
>> required collects.
>> 
>> Am I doing something wroing? Please help!
>
>Can you provide an example?
>
>I tried:
>
> x.rkt
> -----
> #lang racket/gui
> (require "y.rkt")
> (module+ main (go))
>
> y.rkt
> -----
> #lang racket
> (provide go)
> (define (go) (place-wait (place p 10)))
>
>and "x.rkt" works both when run directory or as separate executable.
>
>In contrast,
>
> z.rkt
> -----
> #lang racket/gui
> (define (go) (place-wait (place p 10)))
> (module+ main (go))
>
>fails in both modes (as you report and as expected).
>


-- 
Roman Klochkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140215/09063e9a/attachment.html>

Posted on the users mailing list.