[[tags: egg]] == module-declarations [[toc:]] === Description Extends CHICKEN's [[/man/4/Declarations|declaration]] mechanism with forms for controlling modules, imports and exports. The source for this egg is available [[http://git.foldling.org/chicken-module-declarations.git|here]]. ==== Requirements * [[/egg/matchable|matchable]] === Usage {{module-declarations}} should be loaded as a compiler extension with the {{-extend}} (or {{-X}}) flag to {{csc}}: $ csc -extend module-declarations ==== API When extended, {{module-declarations}} adds three declaration specifiers, [[#module|{{module}}]], [[#import|{{import}}]], and [[#export|{{export}}]]. These correspond to the [[/man/4/Modules|module forms]] of the same names. ===== module [declaration specifier] (module name) Wraps the current file in a [[/man/4/Modules#module|{{(module ...)}}]] form. Modules declared in this way implicitly import the {{scheme}}, {{chicken}}, and {{foreign}} modules before any others. If more than one {{module}} declaration is provided, the one appearing last takes precendence. ===== import [declaration specifier] (import library ...) Loads the given libraries into the current module using [[/man/4/Non-standard macros and special forms#require-extension|{{require-extension}}]] semantics. If no {{module}} is declared, this specifier has no effect. ===== export [declaration specifier] (export identifier ...) Registers the given identifiers as exports of the current module, as with [[/man/4/Modules#export|export]]. If no {{module}} is declared, this specifier has no effect. ==== Example (declare (module alphabet-soup) (import abc def ghi) (export uvw xyz)) ; module content follows... === Author [[/users/evan-hanson|Evan Hanson]] === License Copyright (c) 2014, 3-Clause BSD.