\documentclass{article} \usepackage{noweb} \usepackage[latin1]{inputenc} %\usepackage[english,francais]{babel} \title{Max: A Framework for Reflection} \author{David E. Manifold (Tril) \url{}} \usepackage{url} % Define ``if'' statement to allow different code for PDF and Non-PDF output \newif\ifPDF \ifx\pdfoutput\undefined\PDFfalse \else\ifnum\pdfoutput > 0\PDFtrue \else\PDFfalse \fi \fi % Do not use the hyperref package unless processed by pdflatex: % otherwise this line causes ``Undefined control sequence'' for \pdfoutput \ifPDF % NOTE: hyperref has to be the last command in the preamble \usepackage[pdftex,colorlinks]{hyperref} \fi \begin{document} \maketitle \newpage \tableofcontents \newpage \section{Acknowledgements} Thanks to Justin R. Hall (HenZo) \url{} for help pair programming, and for trying to catch up. I hope this document will allow you to catch up for good. \def\viet{% \def\?##1{\hbox{\raise.5ex\hbox{\kern.2em\mark\char39}\kern-.5em##1}}% \let\~=\tilda% } \def\Viet#1{{\viet #1}} \def\tilda#1{{\accent''7E #1}} \def\dd{\kern.1em\hbox{d\raise.9ex\hbox{\kern-.3em -}}} \def\DD{\hskip.1pt\hbox{D\raise.3ex\hbox{\kern-.7em\char45}\kern.4em}} \def\nga#1{\hbox{\raise.0ex\hbox{\char126}\kern-.55em#1}} \def\nan#1{\oalign{#1\crcr\hidewidth.\hidewidth}} \def\dangvu{\Viet{\DD\nan{\u{a}}ng-V\nga{u}}} %\tilda{U}}} \def\ban{\Viet{B\^an}} Thanks to François-René Rideau {\dangvu} {\ban} (Faré) \url{} for starting the TUNES project. I hope Max will be useful, nevertheless expedient enough to focus and provide direction to the project. \newpage \section{Introduction} Max is a framework for a reflective computing system. For a system to be reflective, it needs two complementary capabilities: Introspection, the ability to examine any part of the system; and dynamism, the ability to modify any part of the system by replacing it with a functionally equivalent one. Max provides a clean model of the system, with fully generic, non-redundant abstractions, and a model of computation that unifies all known programming paradigms. The exact meaning of this description will be made clear in the sections that follow, as we examine the purpose and implementation of each component. This implementation is in Common LISP using an iterative development cycle. This is iteration \#1, intended to implement the basic functionality in every required component of Max, and to demonstrate the overall design. Iteration 1 is not yet complete. Our TODO list %in section \ref{todos} describes the remaining tasks for this iteration. This document is produced by ``noweb'', a Literate Programming tool. Literate Programming allows the documentation and code to coexist in the same source file, and to present the entire body of source code to a human being in an understandable order, with explanations. Code is defined in named ``chunks''. Chunks can refer to other chunks (using $\langle$\emph{chunk name}$\rangle$ notation), which are replaced with their contents recursively when noweb creates the source files. Each module has 1 top-level chunk that is the same name as the filename stem of the module. \section{Main module} \subsection{Load modules} This is the main file, called ``max'', and all it does is setup a framework for initializing. Loading is now handled by ASDF. <>= <> <> <> @ \subsection{Initialization} Currently most initialization is done in the individual modules as they are loaded. Each module's initialization consists of creating some global variables, declared with DEFPARAMETER and initialized in the same place they are declared. The global variables store Max objects so they can be accessed from within LISP. Here's a framework for the later modules to define functions to be called after all the modules are loaded. <>= (in-package :max) @ <>= (defparameter *init-hooks* nil) (defun add-init-hook (thunk) (setf *init-hooks* (append *init-hooks* (list thunk))) ) @ <>= (defun init () (map nil #'funcall *init-hooks*) ) (format t "~%Initializing...~%") (init) @ % Now on to the individual modules. \include{test} \include{addr} \include{object} \include{function} \include{ptr} \include{boolean} \include{set} \include{string} \include{eval} \include{catalog} \include{menu} \include{name} \include{adventure} \include{util} \end{document}