%%% -*-latex-*-
%%%
%%% Modules
%%%
%%% (c) 2015 Straylight/Edgeware
%%%

%%%----- Licensing notice ---------------------------------------------------
%%%
%%% This file is part of the Sensible Object Design, an object system for C.
%%%
%%% SOD is free software; you can redistribute it and/or modify
%%% it under the terms of the GNU General Public License as published by
%%% the Free Software Foundation; either version 2 of the License, or
%%% (at your option) any later version.
%%%
%%% SOD is distributed in the hope that it will be useful,
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%%% GNU General Public License for more details.
%%%
%%% You should have received a copy of the GNU General Public License
%%% along with SOD; if not, write to the Free Software Foundation,
%%% Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

\chapter{Modules} \label{ch:module}

%%%--------------------------------------------------------------------------

\begin{describe}{fun}{add-module-binding @<symbol> @<thunk>}
\end{describe}

\begin{describe}{mac}{define-module-var @<name> @<value-form> @<doc-string>}
\end{describe}

\begin{describe}{mac}
    {with-module-environment (@[@<module>@]) @<declaration>^* @<form>^*}
\end{describe}

\begin{describe}{fun}{add-clear-the-decks-function @<symbol> @<thunk>}
\end{describe}

\begin{describe}{mac}
  {define-clear-the-decks @<symbol>
    @[[ @<declaration>^* @! @<doc-string> @]]
    @<form>^*}
\end{describe}

\begin{describe}{cls}
    {module () \&key :name :pset :items :dependencies :variables :state}
\end{describe}

\begin{describe*}
    {\dhead{gf}{module-name @<module> @> @<pathname>}
     \dhead{gf}{module-pset @<module> @> @<pset>}
     \dhead{gf}{module-errors @<module> @> @<integer>}
     \dhead{gf}{module-items @<module> @> @<list>}
     \dhead{gf}{module-dependencies @<module> @> @<list>}
     \dhead{gf}{module-state @<module> @> @<keyword>}}
\end{describe*}

\begin{describe}{var}{*module*}
\end{describe}

\begin{describe}{gf}{module-import @<object>}
\end{describe}

\begin{describe}{gf}{add-to-module @<module> @<item>}
\end{describe}

\begin{describe}{gf}{finalize-module @<module>}
\end{describe}

\begin{describe}{mac}
    {define-module
        (@<name> @[[ :truename @<pathname> @! :location @<floc> @]])
      @<declaration>^*
      @<form>^*
     \nlret @<module>}
\end{describe}

\begin{describe}{mac}{with-temporary-module () @<declaration>^* @<body>^*}
\end{describe}

\begin{describe}{cls}{type-item () \&key :name}
\end{describe}

\begin{describe}{cls}
    {code-fragment-item () \&key :fragment :reason :name :constraints}
\end{describe}

\begin{describe*}
    {\dhead{gf}{code-fragment @<fragment-item> @> @<fragment>}
     \dhead{gf}{code-fragment-name @<fragment-item> @> @<name>}
     \dhead{gf}{code-fragment-reason @<fragment-item> @> @<keyword>}
     \dhead{gf}{code-fragment-constraints @<fragment-item> @> @<list>}}
\end{describe*}

\begin{describe}{var}{*module-dirs*}
\end{describe}

\begin{describe}{fun}{find-file @<scanner> @<name> @<what> @<thunk>}
\end{describe}

\begin{describe}{fun}
    {read-module @<pathname> \&key :truename :location @> @<module>}
\end{describe}

\begin{describe}{plug}{module @<scanner> @<pset>}
\end{describe}

\begin{describe}{plug}{class-item @<scanner> @<class> @<pset>}
\end{describe}

\begin{describe}{var}{*builtin-module*}
\end{describe}

\begin{describe}{fun}{make-builtin-module @> @<module>}
\end{describe}

%%%----- That's all, folks --------------------------------------------------

%%% Local variables:
%%% mode: LaTeX
%%% TeX-master: "sod.tex"
%%% TeX-PDF-mode: t
%%% End:
