At Wed, 14 Mar 2018 22:42:33 +0100, "'Paulo Matos' via Racket Users" wrote:
>   (define bunit@
>     (dynamic-require path-to-unit 'my-base-unit@))
> 
> [...]
> define-compound-unit/infer: unknown unit definition
>   at: bunit@
>   in: (define-compound-unit/infer my-compound@ (import) (export
> class-sig^) (link bunit@ my-unit@))
>   errortrace...:
>   context...:
>
> [...]
> 
> I am surprised that it complains about bunit@ even though it was defined
> on the dynamic-require line. Why is this?
>
> I assume it might have to do with the different phases of the compiler
> but I am unsure of the details.

Yes, the message "unknown unit definition" is perhaps too terse. A more
complete message would be "no information is known statically about a
unit that might turn out to be the value of `bunit@`; in particular,
the import and export signatures are not statically known".

Assuming you do know the expected import and export signatures, you can
use `define-unit-binding` to bind `bunit@` and have its implementation
be supplied by the `dynamic-require` expression.

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to