Changeset 10227


Ignore:
Timestamp:
10/25/05 14:44:24 (16 years ago)
Author:
piso
Message:

Slavishly emulate Allegro.

File:
1 edited

Legend:

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

    r10223 r10227  
    33 *
    44 * Copyright (C) 2005 Peter Graves
    5  * $Id: jclass_of.java,v 1.1 2005-10-25 13:58:32 piso Exp $
     5 * $Id: jclass_of.java,v 1.2 2005-10-25 14:44:24 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2727    private jclass_of()
    2828    {
    29         super(Symbol.JCLASS_OF, "object &optional name");
     29        super(Symbol.JCLASS_OF, "object &optional name",
     30"Returns the name of the Java class of OBJECT. If the NAME argument is\n" +
     31"  supplied, verifies that OBJECT is an instance of the named class. The name\n" +
     32"  of the class or nil is always returned as a second value.");
    3033    }
    3134
     
    3942            className = ((JavaObject)arg).getObject().getClass().getName();
    4043        else
    41             return signalTypeError(arg, Symbol.JAVA_OBJECT);
    42         SimpleString value = new SimpleString(className);
     44            className = null;
     45        final LispObject value =
     46            (className != null) ? new SimpleString(className) : NIL;
    4347        return LispThread.currentThread().setValues(value, value);
    4448    }
     
    5357            className = ((JavaObject)first).getObject().getClass().getName();
    5458        else
    55             return signalTypeError(first, Symbol.JAVA_OBJECT);
    56         String suppliedName = javaString(second);
    57         return LispThread.currentThread().setValues(className.equals(suppliedName) ? T : NIL,
     59            className = null;
     60        String name = javaString(second);
     61        return LispThread.currentThread().setValues(name.equals(className) ? T : NIL,
    5862                                                    new SimpleString(className));
    5963    }
Note: See TracChangeset for help on using the changeset viewer.