[racket] provide and require in submodules
Thanks Matthew,
Is this also the same/similar bug but with submodule path as filename?
This works:
-----------------------------------------------------------------
#lang racket ;; client.rkt
(require (submod "things.rkt" extra-things))
(displayln thing-a)
#lang racket ;; things.rkt
(provide thing-a thing-b)
(define thing-a 'thing-a)
(define thing-b 'thing-b)
(module+ extra-things
(provide (all-from-out (submod "..")))
(provide all-defined-out)
(define extra-thing-c 'extra-thing-c)
(define extra-thing-d 'extra-thing-d))
RUNNING client.rkt GIVES:
> thing-a
------------------------------
BUT
#lang racket ;; client.rkt
(require (submod "things.rkt" extra-things))
(displayln thing-a)
#lang racket ;; things.rkt
(provide thing-a thing-b)
(define thing-a 'thing-a)
(define thing-b 'thing-b)
(module+ extra-things
(provide (all-from-out "things.rkt")) ;;CHANGED (submod "..")
;;TO "things.rkt"
(provide all-defined-out)
(define extra-thing-c 'extra-thing-c)
(define extra-thing-d 'extra-thing-d))
------------------------
RUNNING client.rkt GIVES ERROR
things.rkt:8:25: all-from-out: no corresponding require in: "things.rkt"
Thanks,
Harry Spier
On Fri, Nov 23, 2012 at 10:31 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> That's a bug. I've pushed a repair to the git repo.
>
> Thanks for the report!
>
> At Tue, 20 Nov 2012 23:19:30 -0500, Harry Spier wrote:
> > Dear list members,
> >
> > This works in DrRacket:
> > definitions window
> > -------------------------
> > #lang racket
> > (module+ server
> > (provide a-from-server)
> > (define a-from-server 'a-from-server))
> >
> > (module+ client
> > (module server2 racket
> > (provide b-from-server2)
> > (define b-from-server2 'b-from-server2))
> >
> > (require (submod ".." server))
> > (provide (all-from-out (submod ".." server)))
> >
> > (require 'server2)
> > (provide (all-from-out (submod "." server2))))
> >
> > (module+ main
> > (require (submod ".." client))
> > a-from-server
> > b-from-server2)
> >
> > Results in interactions window
> > ---------------
> > >
> > 'a-from-server
> > 'b-from-server2
> >
> > BUT the following gives me the error: "all-from-out: no corresponding
> > require in: (quote server2)"
> > Could someone explain why I'm getting this error.
> >
> > Definitions window
> > ------------------
> > #lang racket
> > (module+ server
> > (provide a-from-server)
> > (define a-from-server 'a-from-server))
> >
> > (module+ client
> > (module server2 racket
> > (provide b-from-server2)
> > (define b-from-server2 'b-from-server2))
> >
> > (require (submod ".." server))
> > (provide (all-from-out (submod ".." server)))
> >
> > (require 'server2)
> > (provide (all-from-out 'server2))) ;;;CHANGED (submod "." server2) TO
> > 'server2
> >
> > (module+ main
> > (require (submod ".." client))
> > a-from-server
> > b-from-server2)
> >
> > Thanks,
> > Harry Spier
> > ____________________
> > Racket Users list:
> > http://lists.racket-lang.org/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121123/452529a3/attachment-0001.html>