Changeset 14369
- Timestamp:
- 02/13/13 19:01:20 (11 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/Autoload.java
r14368 r14369 44 44 protected final String className; 45 45 46 pr ivatefinal Symbol symbol;46 protected final Symbol symbol; 47 47 48 48 protected Autoload(Symbol symbol) … … 263 263 StringBuilder sb = new StringBuilder(); 264 264 sb.append(symbol.princToString()); 265 sb.append(" \"");265 sb.append(" stub to be autoloaded from \""); 266 266 if (className != null) { 267 267 int index = className.lastIndexOf('.'); … … 273 273 } else 274 274 sb.append(getFileName()); 275 sb.append("\""); 275 276 return unreadableString(sb.toString()); 276 277 } … … 278 279 public static final Primitive AUTOLOAD = new pf_autoload(); 279 280 @DocString(name="autoload", 280 args="symbol-or-symbols filename",281 args="symbol-or-symbols &optional filename", 281 282 doc="Setup the autoload for SYMBOL-OR-SYMBOLS optionally corresponding to FILENAME.") 282 283 private static final class pf_autoload extends Primitive { … … 732 733 autoload(PACKAGE_JAVA, "%jget-property-value", "JavaBeans", false); 733 734 autoload(PACKAGE_JAVA, "%jset-property-value", "JavaBeans", false); 735 736 autoload(PACKAGE_EXT, "autoload-setf-expander", "AutoloadGeneralizedReference", true); 737 autoload(PACKAGE_EXT, "autoload-setf-function", "AutoloadGeneralizedReference", true); 738 autoload(PACKAGE_EXT, "autoload-ref-p", "AutoloadGeneralizedReference", true); 734 739 } 735 740 } -
trunk/abcl/src/org/armedbear/lisp/Lisp.java
r14256 r14369 2770 2770 loadClass("org.armedbear.lisp.Autoload"); 2771 2771 loadClass("org.armedbear.lisp.AutoloadMacro"); 2772 loadClass("org.armedbear.lisp.AutoloadGeneralizedReference"); 2772 2773 loadClass("org.armedbear.lisp.cxr"); 2773 2774 loadClass("org.armedbear.lisp.Do"); -
trunk/abcl/src/org/armedbear/lisp/Primitives.java
r14254 r14369 3575 3575 3576 3576 // ### put symbol indicator value => value 3577 p rivatestatic final Primitive PUT = new pf_put();3577 public static final Primitive PUT = new pf_put(); 3578 3578 private static final class pf_put extends Primitive { 3579 3579 pf_put() { -
trunk/abcl/src/org/armedbear/lisp/asdf.lisp
r14362 r14369 50 50 (in-package :cl-user) 51 51 52 #+abcl53 (eval-when (:load-toplevel :compile-toplevel :execute)54 (documentation 'car 'function)) ;; workaround (SETF DOCUMENTATION) autoloader bug52 ;; #+abcl 53 ;; (eval-when (:load-toplevel :compile-toplevel :execute) 54 ;; (documentation 'car 'function)) ;; workaround (SETF DOCUMENTATION) autoloader bug 55 55 56 56 #+cmu -
trunk/abcl/src/org/armedbear/lisp/clos.lisp
r14347 r14369 1781 1781 ;; a good option either: we've seen that lead to 1782 1782 ;; recursive loading of the same file 1783 (not (autoloadp function-name)))) 1783 (and (not (autoloadp function-name)) 1784 (and (consp function-name) 1785 (eq 'setf (first function-name)) 1786 (not (autoload-ref-p (second function-name))))))) 1784 1787 (error 'program-error 1785 1788 :format-control "~A already names an ordinary function, macro, or special operator." … … 4479 4482 (setf generic-function-class (find-class generic-function-class))) 4480 4483 (when (and (null *clos-booting*) (fboundp function-name)) 4481 (if (autoloadp function-name) 4484 (if (or (autoloadp function-name) 4485 (and (consp function-name) 4486 (eq 'setf (first function-name)) 4487 (autoload-ref-p (second function-name)))) 4482 4488 (fmakunbound function-name) 4483 4489 (error 'program-error -
trunk/abcl/src/org/armedbear/lisp/compile-file.lisp
r14260 r14369 47 47 (defvar *toplevel-macros*) 48 48 (defvar *toplevel-exports*) 49 (defvar *toplevel-setf-expanders*) 50 (defvar *toplevel-setf-functions*) 49 51 50 52 … … 424 426 (note-name-defined (second form)) 425 427 (push (second form) *toplevel-functions*) 428 (when (and (consp (second form)) 429 (eq 'setf (first (second form)))) 430 (push (second (second form)) 431 *toplevel-setf-functions*)) 426 432 (let ((*compile-print* nil)) 427 433 (process-toplevel-form (macroexpand-1 form *compile-file-environment*) … … 551 557 (note-name-defined name) 552 558 (push name *toplevel-functions*) 559 (when (and (consp name) 560 (eq 'setf (first name))) 561 (push (second name) *toplevel-setf-functions*)) 553 562 ;; If NAME is not fbound, provide a dummy definition so that 554 563 ;; getSymbolFunctionOrDie() will succeed when we try to verify that … … 606 615 (when (and (symbolp operator) 607 616 (macro-function operator *compile-file-environment*)) 617 (when (eq operator 'define-setf-expander) ;; ??? what if the symbol is package qualified? 618 (push (second form) *toplevel-setf-expanders*)) 619 (when (and (eq operator 'defsetf) ;; ??? what if the symbol is package qualified? 620 (consp (third form))) ;; long form of DEFSETF 621 (push (second form) *toplevel-setf-expanders*)) 608 622 (note-toplevel-form form) 609 623 ;; Note that we want MACROEXPAND-1 and not MACROEXPAND here, in … … 614 628 stream compile-time-too)) 615 629 (return-from process-toplevel-form)) 616 617 630 (cond 618 631 ((and (symbolp operator) … … 718 731 (defun compile-from-stream (in output-file temp-file temp-file2 719 732 extract-toplevel-funcs-and-macros 720 functions-file macros-file exports-file) 733 functions-file macros-file exports-file 734 setf-functions-file setf-expanders-file) 721 735 (let* ((*compile-file-pathname* (make-pathname :defaults (pathname in) 722 736 :version nil)) … … 778 792 (symbol-package func-name) 779 793 T)) 780 (remove-duplicates *toplevel-functions*))) 794 (remove-duplicates 795 *toplevel-functions*))) 781 796 (when *toplevel-functions* 782 797 (with-open-file (f-out functions-file … … 812 827 :if-exists :supersede) 813 828 (let ((*package* (find-package :keyword))) 814 (write *toplevel-exports* :stream e-out))))) 829 (write *toplevel-exports* :stream e-out)))) 830 (setf *toplevel-setf-functions* 831 (remove-if-not (lambda (sym) 832 (if (symbolp sym) 833 (symbol-package sym) 834 T)) 835 (remove-duplicates *toplevel-setf-functions*))) 836 (when *toplevel-setf-functions* 837 (with-open-file (e-out setf-functions-file 838 :direction :output 839 :if-does-not-exist :create 840 :if-exists :supersede) 841 (let ((*package* (find-package :keyword))) 842 (write *toplevel-setf-functions* :stream e-out)))) 843 (setf *toplevel-setf-expanders* 844 (remove-if-not (lambda (sym) 845 (if (symbolp sym) 846 (symbol-package sym) 847 T)) 848 (remove-duplicates *toplevel-setf-expanders*))) 849 (when *toplevel-setf-expanders* 850 (with-open-file (e-out setf-expanders-file 851 :direction :output 852 :if-does-not-exist :create 853 :if-exists :supersede) 854 (let ((*package* (find-package :keyword))) 855 (write *toplevel-setf-expanders* :stream e-out))))) 815 856 (with-open-file (in temp-file :direction :input :external-format *fasl-external-format*) 816 857 (with-open-file (out temp-file2 :direction :output … … 901 942 (macros-file (pathname-with-type output-file "macs")) 902 943 (exports-file (pathname-with-type output-file "exps")) 944 (setf-functions-file (pathname-with-type output-file "setf-functions")) 945 (setf-expanders-file (pathname-with-type output-file "setf-expanders")) 903 946 *toplevel-functions* 904 947 *toplevel-macros* 905 *toplevel-exports*) 948 *toplevel-exports* 949 *toplevel-setf-functions* 950 *toplevel-setf-expanders*) 906 951 (with-open-file (in input-file :direction :input :external-format external-format) 907 952 (multiple-value-bind (output-file-truename warnings-p failure-p) 908 953 (compile-from-stream in output-file temp-file temp-file2 909 954 extract-toplevel-funcs-and-macros 910 functions-file macros-file exports-file) 955 functions-file macros-file exports-file 956 setf-functions-file setf-expanders-file) 911 957 (values (truename output-file) warnings-p failure-p)))))) 912 958 -
trunk/abcl/src/org/armedbear/lisp/compile-system.lisp
r14346 r14369 149 149 (null (cdr x))) 150 150 (mapcar (lambda (x) 151 (cons (car x)151 (cons (car x) 152 152 (remove-if-not (lambda (x) 153 ;;; ### TODO: Support SETF functions 154 (and (symbolp x) 155 (eq (symbol-package x) 156 filter-package))) 153 (and (symbolp x) 154 (eq (symbol-package x) 155 filter-package))) 157 156 (cdr x)))) 158 157 filesets-symbols)))) … … 175 174 176 175 (defun generate-autoloads (symbol-files-pathspec) 177 (flet ((filter-combos (combos) 178 (remove-multi-combo-symbols 179 (remove-if (lambda (x) 180 ;; exclude the symbols from the files 181 ;; below: putting autoloaders on some of 182 ;; the symbols conflicts with the bootstrapping 183 ;; Primitives which have been defined Java-side 184 (member x '( ;; function definitions to be excluded 185 "fdefinition" "early-defuns" 186 "require" "signal" "restart" 187 188 ;; extensible sequences override 189 ;; lots of default functions; 190 ;; java-collections implements 191 ;; extensible sequences 192 "extensible-sequences-base" 193 "extensible-sequences" "java-collections" 194 195 ;; macro definitions to be excluded 196 "macros" ;; "backquote" 197 "precompiler") 198 :test #'string=)) 199 combos 200 :key #'first))) 201 (symbols-pathspec (filespec) 202 (merge-pathnames filespec symbol-files-pathspec))) 176 (labels ((filter-combos (combos) 177 (remove-multi-combo-symbols 178 (remove-if (lambda (x) 179 ;; exclude the symbols from the files 180 ;; below: putting autoloaders on some of 181 ;; the symbols conflicts with the bootstrapping 182 ;; Primitives which have been defined Java-side 183 (member x '( ;; function definitions to be excluded 184 "fdefinition" "early-defuns" 185 "require" "signal" "restart" 186 187 ;; extensible sequences override 188 ;; lots of default functions; 189 ;; java-collections implements 190 ;; extensible sequences 191 "extensible-sequences-base" 192 "extensible-sequences" "java-collections" 193 194 ;; macro definitions to be excluded 195 "macros" ;; "backquote" 196 "precompiler") 197 :test #'string=)) 198 combos 199 :key #'first))) 200 (filter-setf-combos (combos) 201 (filter-combos 202 (remove-multi-combo-symbols 203 (remove-if (lambda (x) (member x '("clos") :test #'string=)) combos :key #'first)))) 204 (symbols-pathspec (filespec) 205 (merge-pathnames filespec symbol-files-pathspec))) 203 206 (let ((funcs (filter-combos (load-combos (symbols-pathspec "*.funcs")))) 204 207 (macs (filter-combos (load-combos (symbols-pathspec "*.macs")))) 208 (setf-functions (filter-setf-combos (load-combos (symbols-pathspec "*.setf-functions")))) 209 (setf-expanders (filter-setf-combos (load-combos (symbols-pathspec "*.setf-expanders")))) 205 210 (exps (filter-combos (load-combos (symbols-pathspec "*.exps"))))) 206 211 (with-open-file (f (symbols-pathspec "autoloads-gen.lisp") … … 244 249 (terpri f) 245 250 (write-package-filesets f package 'ext:autoload-macro 246 (combos-to-fileset-symbols macs))))))) 247 251 (combos-to-fileset-symbols macs)) 252 253 (terpri f) 254 255 (write-line ";; SETF-FUNCTIONS" f) 256 (terpri f) 257 (write-package-filesets f package 'ext:autoload-setf-function 258 (combos-to-fileset-symbols setf-functions)) 259 (terpri f) 260 (write-line ";; SETF-EXPANDERS" f) 261 (terpri f) 262 (write-package-filesets f package 'ext:autoload-setf-expander 263 (combos-to-fileset-symbols setf-expanders))))))) 248 264 249 265 ;;
Note: See TracChangeset
for help on using the changeset viewer.