As Sorawee has said. To expand a bit. First,
#lang modname is a shorthand for: (module a-name modname) where a-name derives from the filename. So, modules within are actually submodules. On the other hand, the .. in the submod is a relative module path. The symbol is borrowed, I believe, from Unix. where '.' means the current path, and '..' means the parent of the current path. Here, '..' points to the enclosing module. On Wednesday, August 7, 2019 at 12:58:22 AM UTC+2, lysseus wrote: > > Is there a way to define 2 modules within a file and reference them or is > a file limited to 1 module only (but may have multiple submodules)? > > Here’s a small sample: > > #lang racket > > (module A racket > ˘ (provide X) > (define X 'foo)) > > (module B racket > (require 'A) > (printf "X=~a~%" X)) > > Apparently, as I understand it, I’m already nesting modules within the > #lang racket. But I’m not sure how to require A from within B in this > situation. > > Kevin -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/785bded4-2345-42ac-88a2-ef5077c289bc%40googlegroups.com.