[r6rs-discuss] Proposed features for small Scheme, part 9: modules
Peter Bex
Peter.Bex at xs4all.nl
Mon Oct 12 16:36:44 EDT 2009
On Mon, Oct 12, 2009 at 04:17:25PM -0400, John Cowan wrote:
> Peter Bex scripsit:
>
> > Is that the only use case? In that case I'd just put something like the
> > following at toplevel:
> >
> > (cond-expand (not %bignums)
> > (error "Sorry, but this package requires bignum support"))
>
> Yes, that works at top level, but not within a module, which is why
> I provided special syntax for modules.
I meant the module's toplevel. Modules have their own toplevel where
you can put forms which are evaluated when the module is (first)
loaded or imported.
So if you have
(module foo
(bar)
(cond-expand (not %bignums)
(error "Sorry, but this package requires bignum support")))
The code
(require-library foo)
would cause the error to be printed.
Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 478 bytes
Desc: not available
Url : http://lists.r6rs.org/pipermail/r6rs-discuss/attachments/20091012/7a154721/attachment.pgp
More information about the r6rs-discuss
mailing list