[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: guile and XML (mixp)
From: |
Neil Jerram |
Subject: |
Re: guile and XML (mixp) |
Date: |
Mon, 27 Nov 2006 22:05:38 +0000 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Jon Wilson <address@hidden> writes:
> Hi Neil,
>> Whoever is doing (use-modules (ice-9 syncase)) needs to do (use-syntax
>> (ice-9 syncase)) instead.
>>
> I see this fairly often. Perhaps there should be some little widget
> in (ice-9 syncase) which says "If you try to use=modules me, you will
> actually get use-syntax instead.). Or could an argument be made for
> combining use-modules and use-syntax? Are there any cases where one
> would write a module, and then at some times want to use-modules it,
> and at other times want to use-syntax it, so that the user would need
> to specify which one was wanted?
It's conceivable, but probably quite unlikely.
I'm not sure I like the idea of a module automagically switching its
user's intent from use-module to use-syntax. That feels too
non-explicit to me.
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?
Regards,
Neil