Changeset 4567


Ignore:
Timestamp:
10/29/03 09:24:49 (19 years ago)
Author:
asimon
Message:

JFIELD accepts class-ref argument

File:
1 edited

Legend:

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

    r4545 r4567  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Java.java,v 1.14 2003-10-26 14:54:32 piso Exp $
     5 * $Id: Java.java,v 1.15 2003-10-29 09:24:49 asimon Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    5151     * Supported argument patterns:
    5252     *
    53      *   Case 1: class-name  field-name:
     53     *   Case 1: class-ref  field-name:
    5454     *               to retrieve the value of a static field.
    5555     *
    56      *   Case 2: class-name  field-name  instance-ref:
     56     *   Case 2: class-ref  field-name  instance-ref:
    5757     *               to retrieve the value of a class field of the instance.
    5858     *
    59      *   Case 3: class-name  field-name  primitive-value:
     59     *   Case 3: class-ref  field-name  primitive-value:
    6060     *               to store primitive-value in a static field.
    6161     *
    62      *   Case 4: class-name  field-name  instance-ref  value:
     62     *   Case 4: class-ref  field-name  instance-ref  value:
    6363     *               to store value in a class field of the instance.
    6464     *
    65      *   Case 5: class-name  field-name  nil  value:
     65     *   Case 5: class-ref  field-name  nil  value:
    6666     *               to store value in a static field (when value may be
    6767     *               confused with an instance-ref).
     
    8989                    // Cases 1-5.
    9090                    fieldName = LispString.getValue(args[1]);
    91                     className = LispString.getValue(args[0]);
    92                     c = Class.forName(className);
     91        if (args[0] instanceof LispString) {
     92          className = LispString.getValue(args[0]);
     93          c = Class.forName(className);
     94        }
     95        else {
     96          c = (Class)JavaObject.getObject(args[0]);
     97          className = c.getName();
     98        }
    9399                } else {
    94100                    // Cases 6 and 7.
Note: See TracChangeset for help on using the changeset viewer.