[racket] provide and require in submodules
Slight correction. Comment line was too long and wrapped over.
---------- Forwarded message ----------
From: Harry Spier <vasishtha.spier at gmail.com>
Date: Tue, Nov 20, 2012 at 11:19 PM
Subject: provide and require in submodules
To: users <users at racket-lang.org>
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121120/7a230666/attachment.html>