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

Attachment: pgpg4OMuSVjrA.pgp
Description: PGP signature

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to