On 13 Oct 2009, at 12:03 am, John Cowan wrote: > Alaric Snell-Pym scripsit: > >> How do you handle conditional imports based on availability of >> modules? >> >> Eg, "if we have opengl libraries, use them, otherwise do our own slow >> software rendering". > > I think that is best handled by conditional inclusion rather than > conditional import. You write a single module which exports a fixed > interface and then, depending on a con-expand in the body, includes > either > the open-gl glue code or the software emulation code. This relies on > people having the self-discipline to adopt the Scheme48 style of > module, > where the body normally consists only of includes.
So you're allowed to put the imports inside cond-expand if they're in a separate file that gets included, and not otherwise? I'm confused. Sure, using includes like that is a nice way to make your code more manageable, but why should it have any effect on how you conditionalise module metadata? ABS -- Alaric Snell-Pym Work: http://www.snell-systems.co.uk/ Play: http://www.snell-pym.org.uk/alaric/ Blog: http://www.snell-pym.org.uk/archives/author/alaric/ _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
