Changeset 11574


Ignore:
Timestamp:
01/21/09 22:35:44 (12 years ago)
Author:
ehuelsmann
Message:

Introduce LispInteger? super-type to Bignum and Fixnum:

The LispInteger? logically can return both Bignum as well as Fixnum

values for its getInstance() method.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Bignum.java

    r11573 r11574  
    3636import java.math.BigInteger;
    3737
    38 public final class Bignum extends LispObject
     38public final class Bignum extends LispInteger
    3939{
    4040  public final BigInteger value;
    4141
    42   public static LispObject getInstance(long l) {
    43       if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE)
    44           return Fixnum.getInstance((int)l);
    45       else
    46           return new Bignum(l);
     42  public static Bignum getInstance(long l) {
     43    return new Bignum(l);
    4744  }
    4845
  • trunk/abcl/src/org/armedbear/lisp/Fixnum.java

    r11486 r11574  
    3636import java.math.BigInteger;
    3737
    38 public final class Fixnum extends LispObject
     38public final class Fixnum extends LispInteger
    3939{
    4040  public static final Fixnum[] constants = new Fixnum[256];
Note: See TracChangeset for help on using the changeset viewer.