((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/module-declarations" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "egg")) (section 2 "module-declarations" (toc)) (section 2 "Description" (p "Extends CHICKEN's " (int-link "/man/4/Declarations" "declaration") " mechanism with forms for controlling modules, imports and exports.") (p "The source for this egg is available " (link "https://git.foldling.org/chicken-module-declarations.git" "here") ".") (section 3 "Requirements" (ul (li (int-link "matchable"))))) (section 2 "Usage" (p (tt "module-declarations") " should be loaded as a compiler extension with the " (tt "-extend") " (or " (tt "-X") ") flag to " (tt "csc") ":") (pre "   $ csc -extend module-declarations <file>") (section 3 "API" (p "When extended, " (tt "module-declarations") " adds three declaration specifiers, " (int-link "#module" ((tt "module"))) ", " (int-link "#import" ((tt "import"))) ", and " (int-link "#export" ((tt "export"))) ". These correspond to the " (int-link "/man/4/Modules" "module forms") " of the same names.") (section 4 "module" (pre "[declaration specifier] (module name)") (p "Wraps the current file in a " (int-link "/man/4/Modules#module" ((tt "(module ...)"))) " form.") (p "Modules declared in this way implicitly import the " (tt "scheme") " and " (tt "chicken") " units before any others.") (p "If more than one " (tt "module") " declaration is provided, the one appearing last takes precendence.")) (section 4 "import" (pre "[declaration specifier] (import library ...)") (p "Loads the given libraries into the current module using " (int-link "/man/4/Non-standard macros and special forms#require-extension" ((tt "require-extension"))) " semantics.") (p "If no " (tt "module") " is declared, this specifier has no effect.")) (section 4 "import-for-syntax" (pre "[declaration specifier] (import-for-syntax library ...)") (p "Loads the given libraries into the current module using " (int-link "/man/4/Non-standard macros and special forms#require-extension-for-syntax" ((tt "require-extension-for-syntax"))) " semantics.") (p "If no " (tt "module") " is declared, this specifier has no effect.")) (section 4 "export" (pre "[declaration specifier] (export identifier ...)") (p "Registers the given identifiers as exports of the current module, as with " (int-link "/man/4/Modules#export" "export") ".") (p "If no " (tt "module") " is declared, this specifier has no effect."))) (section 3 "Example" (highlight scheme "(declare (module alphabet-soup)\n         (import abc def ghi)\n         (export uvw xyz))\n\n; module content follows..."))) (section 2 "Author" (p (int-link "/users/evan-hanson" "Evan Hanson"))) (section 2 "License" (p "3-Clause BSD")))