diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet
index c9f17b6..7090eff 100644
--- a/books/bookvol9.pamphlet
+++ b/books/bookvol9.pamphlet
@@ -7295,7 +7295,7 @@ $\rightarrow$
\calls{addDomain}{unknownTypeError}
\begin{chunk}{defun addDomain}
(defun |addDomain| (domain env)
- (let (s name tmp1 tmp2 target)
+ (let (s name tmp1)
(cond
((atom domain)
(cond
@@ -7327,6 +7327,103 @@ $\rightarrow$
\end{chunk}
+\defun{getDomainsInScope}{getDomainsInScope}
+The way XLAMs work:
+\begin{verbatim}
+ ((XLAM ($1 $2 $3) (SETELT $1 0 $3)) X "c" V) ==> (SETELT X 0 V)
+\end{verbatim}
+\calls{getDomainsInScope}{get}
+\refsdollar{getDomainsInScope}{CapsuleDomainsInScope}
+\refsdollar{getDomainsInScope}{insideCapsuleFunctionIfTrue}
+\begin{chunk}{defun getDomainsInScope}
+(defun |getDomainsInScope| (env)
+ (declare (special |$CapsuleDomainsInScope| |$insideCapsuleFunctionIfTrue|))
+ (if |$insideCapsuleFunctionIfTrue|
+ |$CapsuleDomainsInScope|
+ (|get| '|$DomainsInScope| 'special env)))
+
+\end{chunk}
+
+\defun{putDomainsInScope}{putDomainsInScope}
+\calls{putDomainsInScope}{getDomainsInScope}
+\calls{putDomainsInScope}{put}
+\calls{putDomainsInScope}{delete}
+\calls{putDomainsInScope}{say}
+\calls{putDomainsInScope}{member}
+\defsdollar{putDomainsInScope}{CapsuleDomainsInScope}
+\refsdollar{putDomainsInScope}{insideCapsuleFunctionIfTrue}
+\begin{chunk}{defun putDomainsInScope}
+(defun |putDomainsInScope| (x env)
+ (let (z newValue)
+ (declare (special |$CapsuleDomainsInScope| |$insideCapsuleFunctionIfTrue|))
+ (setq z (|getDomainsInScope| env))
+ (when (|member| x z) (say "****** Domain: " x " already in scope"))
+ (setq newValue (cons x (|delete| x z)))
+ (if |$insideCapsuleFunctionIfTrue|
+ (progn
+ (setq |$CapsuleDomainsInScope| newValue)
+ env)
+ (|put| '|$DomainsInScope| 'special newValue env))))
+
+\end{chunk}
+
+\defun{isSuperDomain}{isSuperDomain}
+\calls{isSuperDomain}{isSubset}
+\calls{isSuperDomain}{lassoc}
+\calls{isSuperDomain}{opOf}
+\calls{isSuperDomain}{get}
+\begin{chunk}{defun isSuperDomain}
+(defun |isSuperDomain| (domainForm domainFormp env)
+ (cond
+ ((|isSubset| domainFormp domainForm env) t)
+ ((and (eq domainForm '|Rep|) (eq domainFormp '$)) t)
+ (t (lassoc (|opOf| domainFormp) (|get| domainForm '|SubDomain| env)))))
+
+\end{chunk}
+
+\defun{addNewDomain}{addNewDomain}
+\calls{addNewDomain}{augModemapsFromDomain}
+\begin{chunk}{defun addNewDomain}
+(defun |addNewDomain| (domain env)
+ (|augModemapsFromDomain| domain domain env))
+
+\end{chunk}
+
+\defun{augModemapsFromDomain}{augModemapsFromDomain}
+\calls{augModemapsFromDomain}{member}
+\calls{augModemapsFromDomain}{kar}
+\calls{augModemapsFromDomain}{getDomainsInScope}
+\calls{augModemapsFromDomain}{getdatabase}
+\calls{augModemapsFromDomain}{opOf}
+\calls{augModemapsFromDomain}{addNewDomain}
+\calls{augModemapsFromDomain}{listOrVectorElementNode}
+\calls{augModemapsFromDomain}{stripUnionTags}
+\calls{augModemapsFromDomain}{augModemapsFromDomain1}
+\refsdollar{augModemapsFromDomain}{Category}
+\refsdollar{augModemapsFromDomain}{DummyFunctorNames}
+\begin{chunk}{defun augModemapsFromDomain}
+(defun |augModemapsFromDomain| (name functorForm env)
+ (let (curDomainsInScope u innerDom dl)
+ (declare (special |$Category| |$DummyFunctorNames|))
+ (cond
+ ((|member| (or (kar name) name) |$DummyFunctorNames|)
+ env)
+ ((or (equal name |$Category|) (|isCategoryForm| name env))
+ env)
+ ((|member| name (setq curDomainsInScope (|getDomainsInScope| env)))
+ env)
+ (t
+ (when (setq u (getdatabase (|opOf| functorForm) 'superdomain))
+ (setq env (|addNewDomain| (car u) env)))
+ (when (setq innerDom (|listOrVectorElementMode| name))
+ (setq env (|addDomain| innerDom env)))
+ (when (and (pairp name) (eq (qcar name) '|Union|))
+ (dolist (d (|stripUnionTags| (qcdr name)))
+ (setq env (|addDomain| d env))))
+ (|augModemapsFromDomain1| name functorForm env)))))
+
+\end{chunk}
+
\defun{getModemap}{getModemap}
\calls{getModemap}{get}
\calls{getModemap}{compApplyModemap}
@@ -16898,6 +16995,7 @@ if \verb|$InteractiveMode| then use a null outputstream
\getchunk{defun addModemapKnown}
\getchunk{defun addModemap0}
\getchunk{defun addModemap1}
+\getchunk{defun addNewDomain}
\getchunk{defun add-parens-and-semis-to-line}
\getchunk{defun Advance-Char}
\getchunk{defun advance-token}
@@ -16907,6 +17005,7 @@ if \verb|$InteractiveMode| then use a null outputstream
\getchunk{defun argsToSig}
\getchunk{defun augModemapsFromCategory}
\getchunk{defun augModemapsFromCategoryRep}
+\getchunk{defun augModemapsFromDomain}
\getchunk{defun blankp}
\getchunk{defun bumperrorcount}
@@ -17026,6 +17125,7 @@ if \verb|$InteractiveMode| then use a null outputstream
\getchunk{defun freelist}
\getchunk{defun get-a-line}
+\getchunk{defun getDomainsInScope}
\getchunk{defun getModemap}
\getchunk{defun getModemapList}
\getchunk{defun getModemapListFromDomain}
@@ -17055,6 +17155,7 @@ if \verb|$InteractiveMode| then use a null outputstream
\getchunk{defun initial-substring-p}
\getchunk{defun is-console}
\getchunk{defun isListConstructor}
+\getchunk{defun isSuperDomain}
\getchunk{defun isTokenDelimiter}
\getchunk{defun killColons}
@@ -17289,6 +17390,7 @@ if \verb|$InteractiveMode| then use a null outputstream
\getchunk{defun primitiveType}
\getchunk{defun print-defun}
\getchunk{defun push-reduction}
+\getchunk{defun putDomainsInScope}
\getchunk{defun quote-if-string}
diff --git a/changelog b/changelog
index 9f4bc58..3e71e24 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,8 @@
+20110712 tpd src/axiom-website/patches.html 20110712.01.tpd.patch
+20110712 tpd src/interp/lisplib.lisp move function from modemap.lisp
+20110712 tpd src/interp/modemap.lisp removed file
+20110712 tpd src/interp/Makefile remove modemap.lisp
+20110712 tpd books/bookvol9 treeshake compiler, remove modemap.lisp
20110710 tpd src/axiom-website/patches.html 20110710.01.tpd.patch
20110710 tpd src/interp/modemap.lisp treeshake compiler
20110710 tpd books/bookvol9 treeshake compiler
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index f6093d7..b737b78 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -3536,5 +3536,7 @@ books/bookvol9 treeshake compiler
books/bookvol9 treeshake compiler
20110710.01.tpd.patch
books/bookvol9 treeshake compiler
+20110712.01.tpd.patch
+books/bookvol9 treeshake compiler, remove modemap.lisp