Hi,

Neil Jerram <[EMAIL PROTECTED]> writes:

> What seems very reasonable, however, would be a way for a module to
> discover whether it is being loaded for use-syntax or use-module, so
> that it can emit a warning, or even signal an error, if the use is
> inappropriate.
>
> Perhaps something like this...
>
>  (define-module (ice-9 syncase)
>    ...
>    #:use-hook my-use-hook)
>
>  (define (my-use-hook usage)
>    (or (eq? usage #:use-syntax)
>        (error "The (ice-9 syncase) module should always be used by
>    calling (use-syntax ...), not (use-modules ...)")))
>
>  ...
>
> Does that sound reasonable?

I'm not sure extending `define-module' just to solve this specific
problem is a good idea.  In particular, `use-syntax' itself doesn't seem
too reasonable (see [0]).  Thus, in the long-term, it may be preferable
to remove `use-syntax' or replace it with more robust primitives, rather
than working around it.

Thanks,
Ludovic.

[0] http://lists.gnu.org/archive/html/guile-devel/2006-07/msg00019.html


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user

Reply via email to