app.rkt:

#lang racket
(require "words.rkt"
         web-server/servlet)

....


words.rkt:

#lang racket
(require racket/serialize)
(provide (struct-out word) save-words load-words decline)

(serializable-struct word
  (type
   ecc.))

(define-namespace-anchor a)
(define ns (namespace-anchor->namespace a))

....


If I compile app.rkt with "raco exe app.rkt" and "raco distribute appdir app"
and I move the "appdir" directory to another system, when I run ./app it 
crashes with this error:

default-load-handler: cannot open module file
  module path: #<path:/home/rumpz/webapp/words.rkt>
  path: /home/rumpz/webapp/words.rkt
  system error: No such file or directory; errno=2
  context...:
   standard-module-name-resolver
   /usr/share/racket/collects/racket/private/serialize.rkt:654:8: loop
   /usr/share/racket/collects/racket/private/serialize.rkt:649:2: deserialize
   #%mzc:app: [running body]


Even if I don't move from my system but just rename words.rkt, it still 
crashes. From the examples and the documentation I assumed that raco 
automatically included required modules, but it looks like it's just looking 
for the .rkt file (and even with the exact path that it has on the original 
system). What am I doing wrong?

Also, a secondary problem with modules that may be related: I've tried to make 
a copy of the "webapp" directory, called webapp2. When I launch app from the 
new directory, it loads a list of "word" structures from a file I saved them in 
previously, and try to access them with a "word" field (like "word-type") it 
crashes with:

word-type: contract violation;
 given value instantiates a different structure type with the same name
  expected: word?
  given: #<word>

It's like it marked down somewhere that those structs refer to the definition 
of "word" in webapp/words.rkt, and not the one in webapp2/words.rkt

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to