Changeset 3841


Ignore:
Timestamp:
09/17/03 15:00:45 (19 years ago)
Author:
piso
Message:

classOf(), typep()

Location:
trunk/j/src/org/armedbear/lisp
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/Array.java

    r3832 r3841  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: Array.java,v 1.9 2003-09-16 19:01:07 piso Exp $
     5 * $Id: Array.java,v 1.10 2003-09-17 14:55:59 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    124124    }
    125125
     126    public LispClass classOf()
     127    {
     128        return LispClass.ARRAY;
     129    }
     130
    126131    public LispObject typep(LispObject typeSpecifier) throws LispError
    127132    {
     
    130135        if (typeSpecifier == Symbol.SIMPLE_ARRAY)
    131136            return T;
    132         if (typeSpecifier instanceof LispClass) {
    133             final String name = typeSpecifier.getName();
    134             if (name.equals("ARRAY"))
    135                 return T;
    136         }
     137        if (typeSpecifier == LispClass.ARRAY)
     138            return T;
    137139        return super.typep(typeSpecifier);
    138140    }
  • trunk/j/src/org/armedbear/lisp/Cons.java

    r3791 r3841  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Cons.java,v 1.25 2003-09-15 05:02:04 piso Exp $
     5 * $Id: Cons.java,v 1.26 2003-09-17 14:59:50 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4646    }
    4747
     48    public LispClass classOf()
     49    {
     50        return LispClass.CONS;
     51    }
     52
    4853    public LispObject typep(LispObject typeSpecifier) throws LispError
    4954    {
     
    5358            return T;
    5459        if (typeSpecifier == Symbol.SEQUENCE)
     60            return T;
     61        if (typeSpecifier == LispClass.LIST)
     62            return T;
     63        if (typeSpecifier == LispClass.CONS)
     64            return T;
     65        if (typeSpecifier == LispClass.SEQUENCE)
    5566            return T;
    5667        if (typeSpecifier == Symbol.ATOM)
  • trunk/j/src/org/armedbear/lisp/Function.java

    r3414 r3841  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Function.java,v 1.20 2003-08-15 17:18:02 piso Exp $
     5 * $Id: Function.java,v 1.21 2003-09-17 15:00:45 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    102102    }
    103103
     104    public LispClass classOf()
     105    {
     106        return LispClass.FUNCTION;
     107    }
     108
    104109    public LispObject typep(LispObject typeSpecifier) throws LispError
    105110    {
     
    107112            return T;
    108113        if (typeSpecifier == Symbol.COMPILED_FUNCTION)
     114            return T;
     115        if (typeSpecifier == LispClass.FUNCTION)
    109116            return T;
    110117        return super.typep(typeSpecifier);
  • trunk/j/src/org/armedbear/lisp/Package.java

    r3791 r3841  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Package.java,v 1.42 2003-09-15 04:59:28 piso Exp $
     5 * $Id: Package.java,v 1.43 2003-09-17 14:56:53 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    5353    }
    5454
     55    public LispClass classOf()
     56    {
     57        return LispClass.PACKAGE;
     58    }
     59
    5560    public LispObject typep(LispObject typeSpecifier) throws LispError
    5661    {
    5762        if (typeSpecifier == Symbol.PACKAGE)
     63            return T;
     64        if (typeSpecifier == LispClass.PACKAGE)
    5865            return T;
    5966        return super.typep(typeSpecifier);
     
    210217        for (int i = names.length; i-- > 0;) {
    211218            String symbolName = names[i];
     219            // There shouldn't be any internal symbols in the COMMON-LISP
     220            // package.
    212221            Debug.assertTrue(internalSymbols.get(symbolName) == null);
     222            // The symbol in question may have been exported already. If we
     223            // replace an existing symbol, we'll lose any information that
     224            // might be associated with it. So we check first...
    213225            if (externalSymbols.get(symbolName) == null)
    214226                externalSymbols.put(symbolName, new Symbol(symbolName, this));
Note: See TracChangeset for help on using the changeset viewer.