joskoot
September 13, 2026, 1:45pm
1
trying to require a submodule made with module* I get the following error:
require: unknown module
module name: (submod 'anonymous-module[2096977] aap)
I have tried some variations on the line marked with <---, but none of them passed. How do I refer to submodule aap?
#lang racket/base
(define x 1)
(module* aap #f
(define a x)
(provide a))
(module noot (submod ".." aap) ; <---
(provide a))
(require 'noot)
a
samth
September 13, 2026, 7:41pm
2
Submodules created with module* are conceptually "after" their enclosing module; submodules created with module are conceptually "before" their enclosing module. So what you're literally attempting is not possible. You could do this:
#lang racket/base
(define x 1)
(module* aap #f
(define a x)
(provide a))
(module* noot racket
(require (submod ".." aap)) ; <---
(provide a))
However, you cannot then require that into the enclosing module.
Additionally, your use of submod is in the language position, which is probably not what you want.
From the Guide on submodules: