Changeset 3558


Ignore:
Timestamp:
09/02/03 18:28:16 (19 years ago)
Author:
piso
Message:

plusp(), minusp()

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

Legend:

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

    r3554 r3558  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: Bignum.java,v 1.31 2003-09-02 16:27:01 piso Exp $
     5 * $Id: Bignum.java,v 1.32 2003-09-02 18:27:01 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    123123    }
    124124
    125     public LispObject PLUSP() throws TypeError
    126     {
    127         return value.signum() > 0 ? T : NIL;
    128     }
    129 
    130     public LispObject MINUSP() throws TypeError
    131     {
    132         return value.signum() < 0 ? T : NIL;
     125    public boolean plusp()
     126    {
     127        return value.signum() > 0;
     128    }
     129
     130    public boolean minusp()
     131    {
     132        return value.signum() < 0;
    133133    }
    134134
  • trunk/j/src/org/armedbear/lisp/Fixnum.java

    r3554 r3558  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Fixnum.java,v 1.57 2003-09-02 16:26:47 piso Exp $
     5 * $Id: Fixnum.java,v 1.58 2003-09-02 18:26:05 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    132132    }
    133133
    134     public LispObject PLUSP() throws TypeError
    135     {
    136         return value > 0 ? T : NIL;
    137     }
    138 
    139     public LispObject MINUSP() throws TypeError
    140     {
    141         return value < 0 ? T : NIL;
     134    public boolean plusp()
     135    {
     136        return value > 0;
     137    }
     138
     139    public boolean minusp()
     140    {
     141        return value < 0;
    142142    }
    143143
  • trunk/j/src/org/armedbear/lisp/LispFloat.java

    r3542 r3558  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: LispFloat.java,v 1.33 2003-08-30 15:06:47 piso Exp $
     5 * $Id: LispFloat.java,v 1.34 2003-09-02 18:28:16 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    109109    }
    110110
    111     public LispObject PLUSP() throws TypeError
    112     {
    113         return value > 0 ? T : NIL;
    114     }
    115 
    116     public LispObject MINUSP() throws TypeError
    117     {
    118         return value < 0 ? T : NIL;
     111    public boolean plusp()
     112    {
     113        return value > 0;
     114    }
     115
     116    public boolean minusp()
     117    {
     118        return value < 0;
    119119    }
    120120
  • trunk/j/src/org/armedbear/lisp/LispObject.java

    r3554 r3558  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: LispObject.java,v 1.42 2003-09-02 16:25:45 piso Exp $
     5 * $Id: LispObject.java,v 1.43 2003-09-02 18:25:16 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    161161    public LispObject PLUSP() throws TypeError
    162162    {
     163        return plusp() ? T : NIL;
     164    }
     165
     166    public boolean plusp() throws TypeError
     167    {
    163168        throw new TypeError(this, "real number");
    164169    }
    165170
    166171    public LispObject MINUSP() throws TypeError
     172    {
     173        return minusp() ? T : NIL;
     174    }
     175
     176    public boolean minusp() throws TypeError
    167177    {
    168178        throw new TypeError(this, "real number");
  • trunk/j/src/org/armedbear/lisp/Ratio.java

    r3529 r3558  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: Ratio.java,v 1.22 2003-08-26 16:16:58 piso Exp $
     5 * $Id: Ratio.java,v 1.23 2003-09-02 18:27:37 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    115115    }
    116116
    117     public LispObject PLUSP() throws TypeError
    118     {
    119         return (numerator.signum() == denominator.signum()) ? T : NIL;
    120     }
    121 
    122     public LispObject MINUSP() throws TypeError
    123     {
    124         return (numerator.signum() != denominator.signum()) ? T : NIL;
     117    public boolean plusp()
     118    {
     119        return numerator.signum() == denominator.signum();
     120    }
     121
     122    public boolean minusp()
     123    {
     124        return numerator.signum() != denominator.signum();
    125125    }
    126126
Note: See TracChangeset for help on using the changeset viewer.