Don't extend Lisp in LispObject, static import Lisp wherever

necessary. Patch by Douglas R. Miles.
parent 42747305
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public abstract class AbstractArray extends LispObject
{
@Override
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public abstract class AbstractBitVector extends AbstractVector
{
protected static final int LONG_MASK = 0x3f;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public abstract class AbstractString extends AbstractVector
{
@Override
......
......@@ -32,6 +32,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public abstract class AbstractVector extends AbstractArray
{
@Override
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public class ArithmeticError extends LispError
{
protected ArithmeticError(LispClass cls)
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public class Autoload extends Function
{
protected final String fileName;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class AutoloadMacro extends Autoload
{
private AutoloadMacro(Symbol symbol)
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
// A basic vector is a specialized vector that is not displaced to another
// array, has no fill pointer, and is not expressly adjustable.
public final class BasicVector_UnsignedByte16 extends AbstractVector
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
// A basic vector is a specialized vector that is not displaced to another
// array, has no fill pointer, and is not expressly adjustable.
public final class BasicVector_UnsignedByte32 extends AbstractVector
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
// A basic vector is a specialized vector that is not displaced to another
// array, has no fill pointer, and is not expressly adjustable.
public final class BasicVector_UnsignedByte8 extends AbstractVector
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
import java.math.BigInteger;
public final class Bignum extends LispInteger
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class BroadcastStream extends Stream
{
private final Stream[] streams;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public class BuiltInClass extends LispClass
{
private BuiltInClass(Symbol symbol)
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class ByteArrayOutputStream extends Stream
{
private final java.io.ByteArrayOutputStream byteArrayOutputStream;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public abstract class CaseFrobStream extends Stream
{
protected final Stream target;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public class CellError extends LispError
{
protected CellError(LispClass cls)
......
......@@ -33,7 +33,9 @@
package org.armedbear.lisp;
public final class CharacterFunctions extends Lisp
import static org.armedbear.lisp.Lisp.*;
public final class CharacterFunctions extends LispTrampolinesFile
{
// ### char=
private static final Primitive CHAR_EQUALS =
......
......@@ -34,6 +34,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
import java.util.ArrayList;
public class Closure extends Function
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public class CompiledClosure extends Closure
implements Cloneable
{
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public class CompilerError extends Condition
{
public CompilerError(LispObject initArgs)
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public class CompilerUnsupportedFeatureError extends Condition
{
public CompilerUnsupportedFeatureError(LispObject initArgs)
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class Complex extends LispObject
{
public final LispObject realpart;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class ComplexArray extends AbstractArray
{
private final int[] dimv;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class ComplexArray_UnsignedByte32 extends AbstractArray
{
private final int[] dimv;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class ComplexArray_UnsignedByte8 extends AbstractArray
{
private final int[] dimv;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class ComplexBitVector extends AbstractBitVector
{
private int fillPointer = -1; // -1 indicates no fill pointer.
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class ComplexString extends AbstractString
{
private int capacity;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
// A vector that is displaced to another array, has a fill pointer, and/or is
// expressly adjustable. It can hold elements of any type.
public final class ComplexVector extends AbstractVector
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
// A specialized vector of element type (UNSIGNED-BYTE 32) that is displaced to
// another array, has a fill pointer, and/or is expressly adjustable.
public final class ComplexVector_UnsignedByte32 extends AbstractVector
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
// A specialized vector of element type (UNSIGNED-BYTE 8) that is displaced to
// another array, has a fill pointer, and/or is expressly adjustable.
public final class ComplexVector_UnsignedByte8 extends AbstractVector
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class ConcatenatedStream extends Stream
{
private LispObject streams;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public class Condition extends StandardObject
{
protected String message;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class Cons extends LispObject
{
public LispObject car;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class ControlError extends LispError
{
public ControlError(LispObject initArgs)
......
......@@ -33,7 +33,7 @@
package org.armedbear.lisp;
public final class Debug extends Lisp
public final class Debug
{
public static final void assertTrue(boolean b)
{
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public abstract class DispatchMacroFunction extends Function
{
public DispatchMacroFunction(String name)
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class DivisionByZero extends ArithmeticError
{
public DivisionByZero()
......
......@@ -33,7 +33,9 @@
package org.armedbear.lisp;
public final class Do extends Lisp
import static org.armedbear.lisp.Lisp.*;
public final class Do extends LispTrampolinesFile
{
// ### do
private static final SpecialOperator DO =
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
import java.math.BigInteger;
public final class DoubleFloat extends LispObject
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class EchoStream extends Stream
{
private final Stream in;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class EndOfFile extends StreamError
{
public EndOfFile(Stream stream)
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class Environment extends LispObject
{
private Binding vars;
......
......@@ -33,10 +33,12 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
import java.io.File;
import java.io.IOException;
public final class Extensions extends Lisp
public final class Extensions extends LispTrampolinesFile
{
// ### *ed-functions*
public static final Symbol _ED_FUNCTIONS_ =
......
......@@ -33,7 +33,9 @@
package org.armedbear.lisp;
public final class FaslReader extends Lisp
import static org.armedbear.lisp.Lisp.*;
public final class FaslReader extends LispTrampolinesFile
{
// ### fasl-read-comment
public static final ReaderMacroFunction FASL_READ_COMMENT =
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class FileError extends LispError
{
// initArgs is either a normal initArgs list or a pathname.
......
......@@ -34,6 +34,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class FillPointerOutputStream extends Stream
{
private ComplexString string;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
import java.math.BigInteger;
public final class Fixnum extends LispInteger
......
......@@ -33,9 +33,11 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
import java.math.BigInteger;
public final class FloatFunctions extends Lisp
public final class FloatFunctions extends LispTrampolinesFile
{
// ### set-floating-point-modes &key traps => <no values>
private static final Primitive SET_FLOATING_POINT_MODES =
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class FloatingPointInexact extends ArithmeticError
{
public FloatingPointInexact(LispObject initArgs)
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class FloatingPointInvalidOperation extends ArithmeticError
{
public FloatingPointInvalidOperation(LispObject initArgs)
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class FloatingPointOverflow extends ArithmeticError
{
public FloatingPointOverflow(LispObject initArgs)
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class FloatingPointUnderflow extends ArithmeticError
{
public FloatingPointUnderflow(LispObject initArgs)
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public class ForwardReferencedClass extends LispClass
{
public ForwardReferencedClass(Symbol name)
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public abstract class Function extends Operator
{
private LispObject propertyList = NIL;
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public abstract class GenericFunction extends StandardObject
{
protected GenericFunction(LispClass cls, int length)
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public abstract class HashTable extends LispObject
{
private static final int DEFAULT_SIZE = 16;
......
......@@ -33,7 +33,9 @@
package org.armedbear.lisp;
public final class HashTableFunctions extends Lisp
import static org.armedbear.lisp.Lisp.*;
public final class HashTableFunctions extends LispTrampolinesFile
{
private static final LispObject FUNCTION_EQ =
Symbol.EQ.getSymbolFunction();
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
public final class IllegalMonitorState extends ProgramError
{
public IllegalMonitorState()
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
......@@ -40,7 +42,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
public final class Interpreter extends Lisp
public final class Interpreter extends LispTrampolinesFile
{
// There can only be one interpreter.
public static Interpreter interpreter;
......@@ -153,7 +155,7 @@ public final class Interpreter extends Lisp
// Interface.
public LispObject eval(String s)
{
return eval(new StringInputStream(s).read(true, NIL, false,
return Lisp.eval(new StringInputStream(s).read(true, NIL, false,
LispThread.currentThread()));
}
......@@ -334,7 +336,7 @@ public final class Interpreter extends Lisp
break;
out.setCharPos(0);
Symbol.MINUS.setSymbolValue(object);
LispObject result = eval(object, new Environment(), thread);
LispObject result = Lisp.eval(object, new Environment(), thread);
Debug.assertTrue(result != null);
Symbol.STAR_STAR_STAR.setSymbolValue(Symbol.STAR_STAR.getSymbolValue());
Symbol.STAR_STAR.setSymbolValue(Symbol.STAR.getSymbolValue());
......@@ -538,7 +540,7 @@ public final class Interpreter extends Lisp
final SpecialBindingsMark mark = thread.markSpecialBindings();
thread.bindSpecial(Symbol.DEBUGGER_HOOK, _DEBUGGER_HOOK_FUNCTION);
try {
return eval(obj, new Environment(), thread);
return Lisp.eval(obj, new Environment(), thread);
}
finally {
thread.resetSpecialBindings(mark);
......
......@@ -33,11 +33,13 @@
package org.armedbear.lisp;
import static org.armedbear.lisp.Lisp.*;
import java.util.HashMap;
import java.util.Map;
import java.util.WeakHashMap;
public final class JHandler extends Lisp
public final class JHandler extends LispTrampolinesFile
{
private static final Map<Object,Map<String,Entry>> table =
new WeakHashMap<Object,Map<String,Entry>>();
......@@ -80,7 +82,7 @@ public final class JHandler extends Lisp
}
LispObject lispAsVector = new SimpleVector(lispAs);
LispObject[] args = new LispObject[] //FIXME: count -> seq_num
{ data, new JavaObject(o), lispAiVector, lispAsVector, Keyword.internKeyword(s), count };
{ data, new JavaObject(o), lispAiVector, lispAsVector, internKeyword(s), count };
f.execute(args);
}
}
......
......@@ -33,6 +33,8 @@
package org.armedbear.lisp;