On Mon, Oct 12, 2009 at 12:23:33AM -0400, John Cowan wrote: > A small Scheme module takes the general form: > > (module module-name > [(export name ...)] > [(import importspec ...)] > [(feature-groups name ...)] > form ...)
[snip] > The feature-groups list specifies the feature groups which this > implementation must provide in order for the module to work. This is > an extension to R6RS, which does not have feature groups. If the > implementation cannot load the feature groups dynamically, it must > fail to define the module. (Why aren't feature groups just modules? > Because they don't define separate namespaces, and because they mostly > reflect the limitations of particular small Scheme systems rather than > components that can be loaded into them.) What added benefit do feature groups have? If the module cannot be defined because a feature is not implemented, what happens? Is that an error? I'm asking because I suppose it would also be an error to define a module containing references to undefined identifiers. In other words, if a module requires the feature group "regular expressions" (just an example), the implementation would give an error saying regular expressions are not supported. However, if there were no "feature-groups", wouldn't the module declaration give an error saying something like "undefined identifier: regex-match"? In essence, feature groups don't seem to add anything here. Regards, 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
pgppueoUxQHyG.pgp
Description: PGP signature
_______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
