Changeset 2286


Ignore:
Timestamp:
06/11/03 02:04:24 (19 years ago)
Author:
piso
Message:

NIL is a Symbol.

File:
1 edited

Legend:

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

    r2119 r2286  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Symbol.java,v 1.41 2003-06-03 01:55:55 piso Exp $
     5 * $Id: Symbol.java,v 1.42 2003-06-11 02:04:24 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    136136    private LispObject value;
    137137    private LispObject function;
    138     private LispObject propertyList = NIL;
     138    private LispObject propertyList;
    139139    private int flags;
    140140
     
    143143    {
    144144        this.name = name;
    145         pkg = NIL;
    146145    }
    147146
     
    171170    public LispObject getPackage()
    172171    {
    173         return pkg;
     172        return pkg != null ? pkg : NIL;
    174173    }
    175174
     
    179178    }
    180179
    181     public final int getType()
     180    public int getType()
    182181    {
    183182        return TYPE_SYMBOL;
     
    228227    }
    229228
    230     public static LispObject getPropertyList(LispObject obj) throws LispError
    231     {
    232         try {
    233             return ((Symbol)obj).propertyList;
    234         }
    235         catch (ClassCastException e) {
    236             throw new TypeError(obj, "symbol");
    237         }
    238     }
    239 
    240     public final String getName()
     229    public String getName()
    241230    {
    242231        return name;
     
    259248
    260249    // Raw accessor.
    261     public final LispObject getSymbolValue()
     250    public LispObject getSymbolValue()
    262251    {
    263252        return value;
     
    302291    }
    303292
    304     public final LispObject getSymbolFunction()
     293    public LispObject getSymbolFunction()
    305294    {
    306295        return function;
     
    314303    public final LispObject getPropertyList()
    315304    {
    316         return propertyList;
     305        return propertyList != null ? propertyList : NIL;
    317306    }
    318307
    319308    public final void setPropertyList(LispObject obj)
    320309    {
     310        if (obj == null)
     311            throw new NullPointerException();
    321312        propertyList = obj;
    322313    }
Note: See TracChangeset for help on using the changeset viewer.