aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog8
-rw-r--r--src/interp/category.boot8
-rw-r--r--src/interp/lisplib.boot22
-rw-r--r--src/interp/patches.lisp5
4 files changed, 26 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 795f4246..48402b85 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,13 @@
2011-08-25 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/lisplib.boot (autoLoad): Lose first parameter.
+ Adjust callers.
+ (unloadOneConstructor): Likewise.
+ * interp/category.boot (isCategoryForm): Rewrite.
+ * interp/patches.lisp (mkAutoLoad): Move to lisplib.boot.
+
+2011-08-25 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/compiler.boot (compHasFormat): Take environment
argument. Adjust callers.
* interp/define.boot (NRTmakeCategoryAlist): Likewise.
diff --git a/src/interp/category.boot b/src/interp/category.boot
index dd5a9839..5e9ff863 100644
--- a/src/interp/category.boot
+++ b/src/interp/category.boot
@@ -55,10 +55,10 @@ categoryObject? a ==
++ envronement `e'.
isCategoryForm: (%Form,%Env) -> %Boolean
isCategoryForm(x,e) ==
- x isnt [.,:.] =>
- u := macroExpand(x,e)
- cons? u and categoryForm? u
- categoryForm? x
+ if x isnt [.,:.] then
+ x := macroExpand(x,e)
+ x isnt [.,:.] => ident? x and getmode(x,e) = $Category
+ getConstructorKind(x.op) is 'category -- FIXME: check arguments too.
++ Returns a freshly built category object for a domain or package
++ (as indicated by `domainOrPackage'), with signature list
diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot
index 5d952942..97571ddc 100644
--- a/src/interp/lisplib.boot
+++ b/src/interp/lisplib.boot
@@ -400,23 +400,29 @@ makeConstructorsAutoLoad() ==
systemDependentMkAutoload(fn,cnam) ==
FBOUNDP cnam => "next"
- symbolFunction(cnam) := mkAutoLoad(fn, cnam)
+ symbolFunction(cnam) := mkAutoLoad cnam
-autoLoad(abb,cname) ==
+mkAutoLoad ctor ==
+ function((:args) +-> (autoLoad ctor; apply(ctor,args)))
+
+autoLoad cname ==
-- builtin constructors are always loaded. By definition, there
-- is no way to unload them and load them again.
builtinConstructor? cname => cname
- if not property(cname,'LOADED) then loadLib cname
+ if constructorDB cname = nil then
+ makeDB cname
+ if property(cname,'LOADED) = nil then
+ loadLib cname
symbolFunction cname
setAutoLoadProperty(name) ==
--- abb := getConstructorAbbreviationFromDB name
property(name,'LOADED) := nil
- symbolFunction(name) := mkAutoLoad(getConstructorAbbreviationFromDB name, name)
+ symbolFunction(name) := mkAutoLoad name
-unloadOneConstructor(cnam,fn) ==
+unloadOneConstructor cnam ==
property(cnam,'LOADED) := nil
- symbolFunction(cnam) := mkAutoLoad(fn, cnam)
+ symbolFunction(cnam) := mkAutoLoad cnam
+ --FIXME: should not we clear other fields too?
--% Compilation
@@ -502,7 +508,7 @@ compDefineLisplib(df:=["DEF",[op,:.],:.],m,e,prefix,fal,fn) ==
RPACKFILE filearg
FRESH_-LINE $algebraOutputStream
sayMSG fillerSpaces(72,char "-")
- unloadOneConstructor(op,libName)
+ unloadOneConstructor op
LOCALDATABASE([symbolName getConstructorAbbreviationFromDB op],nil)
$newConlist := [op, :$newConlist] ----------> bound in function "compiler"
res
diff --git a/src/interp/patches.lisp b/src/interp/patches.lisp
index 68d17fc9..f9ec2f50 100644
--- a/src/interp/patches.lisp
+++ b/src/interp/patches.lisp
@@ -42,11 +42,6 @@
(define-function '|construct| #'list) ;; NEEDED , SPAD-COMPILER generated Lisp code
-(defun |mkAutoLoad| (fn cname)
- (function (lambda (&rest args)
- (|autoLoad| fn cname)
- (apply cname args))))
-
(defmacro dribinit (streamvar)
`(if (is-console ,streamvar)
(setq ,streamvar *terminal-io*)))