Changeset 8763


Ignore:
Timestamp:
03/13/05 03:56:49 (16 years ago)
Author:
piso
Message:

typeOf(), writeToString()

File:
1 edited

Legend:

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

    r8198 r8763  
    22 * StandardObject.java
    33 *
    4  * Copyright (C) 2003-2004 Peter Graves
    5  * $Id: StandardObject.java,v 1.37 2004-11-28 15:43:50 piso Exp $
     4 * Copyright (C) 2003-2005 Peter Graves
     5 * $Id: StandardObject.java,v 1.38 2005-03-13 03:56:49 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    7373        // class-of if it has a proper name, and otherwise returns the class
    7474        // itself."
    75         Symbol symbol = layout.getLispClass().getSymbol();
    76         if (symbol != NIL)
    77             return symbol;
     75        LispClass c1 = layout.getLispClass();
     76        // The proper name of a class is "a symbol that names the class whose
     77        // name is that symbol".
     78        Symbol symbol = c1.getSymbol();
     79        if (symbol != NIL) {
     80            // TYPE-OF.9
     81            LispObject c2 = LispClass.findClass(symbol);
     82            if (c2 == c1)
     83                return symbol;
     84        }
    7885        return layout.getLispClass();
    7986    }
     
    120127        if (currentLevel >= maxLevel)
    121128            return "#";
    122         LispClass cls = layout.getLispClass();
    123         return unreadableString(cls != null ? cls.getSymbol().getName() : "STANDARD-OBJECT");
     129        return unreadableString(typeOf().writeToString());
    124130    }
    125 
    126131}
Note: See TracChangeset for help on using the changeset viewer.