[armedbear-cvs] r14400 - trunk/abcl/src/org/armedbear/lisp

mevenson at common-lisp.net mevenson at common-lisp.net
Mon Feb 25 14:01:39 UTC 2013


Author: mevenson
Date: Mon Feb 25 06:01:34 2013
New Revision: 14400

Log:
Clean up manually defined autoloads.

Problems involved not correctly defining the actual packages for
autoloaded sysmbol and obsolete declarations.

EXT:RESOLVE no longer fails on undefined symbols.

Refactored contens of stream_external_format.java into Stream.java.

Fixes #302.

Deleted:
   trunk/abcl/src/org/armedbear/lisp/stream_external_format.java
Modified:
   trunk/abcl/src/org/armedbear/lisp/Autoload.java
   trunk/abcl/src/org/armedbear/lisp/Stream.java

Modified: trunk/abcl/src/org/armedbear/lisp/Autoload.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Autoload.java	Sat Feb 23 03:17:50 2013	(r14399)
+++ trunk/abcl/src/org/armedbear/lisp/Autoload.java	Mon Feb 25 06:01:34 2013	(r14400)
@@ -325,7 +325,8 @@
     public static final Primitive RESOLVE = new pf_resolve();
     @DocString(name="resolve", 
                args="symbol",
-               doc="Force the symbol to be resolved via the autoloader mechanism.")
+               doc="Resolve the function named by SYMBOL via the autoloader mechanism.\n"
+               + "Returns either the function or NIL if no resolution was possible.")
     private static final class pf_resolve extends Primitive {
         pf_resolve() {
             super("resolve", PACKAGE_EXT, true, "symbol");
@@ -339,7 +340,7 @@
                 autoload.load();
                 return symbol.getSymbolFunction();
             }
-            return fun;
+            return ((fun == null) ? NIL : fun);
         }
     }
 
@@ -392,7 +393,7 @@
         autoload("cos", "MathFunctions");
         autoload("cosh", "MathFunctions");
         autoload("delete-file", "delete_file");
-        autoload("%delete-package", "PackageFunctions");
+        autoload(PACKAGE_SYS, "%delete-package", "PackageFunctions");
         autoload("echo-stream-input-stream", "EchoStream");
         autoload("echo-stream-output-stream", "EchoStream");
         autoload("exp", "MathFunctions");
@@ -428,7 +429,7 @@
         autoload("hash-table-size", "HashTableFunctions");
         autoload("hash-table-test", "HashTableFunctions");
         autoload("hash-table-test", "HashTableFunctions");
-        autoload("%import", "PackageFunctions");
+        autoload(PACKAGE_SYS, "%import", "PackageFunctions");
         autoload("input-stream-p", "input_stream_p");
         autoload("integer-decode-float", "FloatFunctions");
         autoload("interactive-stream-p", "interactive_stream_p");
@@ -498,7 +499,7 @@
         autoload("stream-element-type", "stream_element_type");
         autoload("stream-error-stream", "StreamError");
         autoload("stream-external-format", "stream_external_format");
-        autoload("%set-stream-external-format", "stream_external_format");
+        autoload(PACKAGE_SYS, "%set-stream-external-format", "Stream");
         autoload("stringp", "StringFunctions");
         autoload("sxhash", "HashTableFunctions");
         autoload("sxhash", "HashTableFunctions");
@@ -630,11 +631,10 @@
         autoload(PACKAGE_SYS, "cache-emf", "StandardGenericFunction", true);
         autoload(PACKAGE_SYS, "cache-slot-location", "StandardGenericFunction", true);
         autoload(PACKAGE_SYS, "canonicalize-logical-host", "LogicalPathname", true);
-        autoload(PACKAGE_SYS, "class-direct-slots", "SlotClass");
+        autoload(PACKAGE_SYS, "%class-direct-slots", "SlotClass");
         autoload(PACKAGE_SYS, "%float-bits", "FloatFunctions");
         autoload(PACKAGE_SYS, "coerce-to-double-float", "FloatFunctions");
         autoload(PACKAGE_SYS, "coerce-to-single-float", "FloatFunctions");
-        autoload(PACKAGE_SYS, "compute-class-direct-slots", "SlotClass", true);
         autoload(PACKAGE_SYS, "create-new-file", "create_new_file");
         autoload(PACKAGE_SYS, "default-time-zone", "Time");
         autoload(PACKAGE_SYS, "disassemble-class-bytes", "disassemble_class_bytes", true);
@@ -667,7 +667,6 @@
         autoload(PACKAGE_SYS, "make-double-float", "FloatFunctions", true);
         autoload(PACKAGE_SYS, "make-file-stream", "FileStream");
         autoload(PACKAGE_SYS, "make-fill-pointer-output-stream", "FillPointerOutputStream");
-        autoload(PACKAGE_SYS, "make-forward-referenced-class", "ForwardReferencedClass", true);
         autoload(PACKAGE_SYS, "make-layout", "Layout", true);
         autoload(PACKAGE_SYS, "make-single-float", "FloatFunctions", true);
         autoload(PACKAGE_SYS, "make-slot-definition", "SlotDefinition", true);

Modified: trunk/abcl/src/org/armedbear/lisp/Stream.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Stream.java	Sat Feb 23 03:17:50 2013	(r14399)
+++ trunk/abcl/src/org/armedbear/lisp/Stream.java	Mon Feb 25 06:01:34 2013	(r14400)
@@ -336,6 +336,42 @@
             ((DecodingReader)reader).setCharset(Charset.forName(encoding));
     }
 
+  public static final Primitive STREAM_EXTERNAL_FORMAT = new pf_stream_external_format();
+  @DocString(
+    name="stream-external-format", 
+    args="stream",
+    doc="Returns the external format of STREAM."
+  )
+  private static final class pf_stream_external_format extends Primitive {
+    pf_stream_external_format() {
+      super("stream-external-format", "stream");
+    }
+    public LispObject execute(LispObject arg) {
+      if (arg instanceof Stream) {
+        return ((Stream)arg).getExternalFormat();
+      } else {
+        return error(new TypeError(arg, Symbol.STREAM));
+      }
+    }
+  }
+
+  // DEFSETF-ed in 'setf.lisp'
+  public static final Primitive SET_STREAM_EXTERNAL_FORMAT = new pf__set_stream_external_format();
+  @DocString(
+    name="%set-stream-external-format",
+    args="stream format"
+  )
+  private static final class pf__set_stream_external_format extends Primitive {
+    pf__set_stream_external_format() {
+        super("%set-stream-external-format",
+              PACKAGE_SYS, false, "stream external-format");
+    }
+    public LispObject execute(LispObject stream, LispObject format) {
+      Stream s = checkStream(stream);
+      s.setExternalFormat(format);
+      return format;
+    }
+  };
 
   public static final Primitive AVAILABLE_ENCODINGS = new pf_available_encodings();
   @DocString(name="available-encodings",




More information about the armedbear-cvs mailing list