Changeset 3485
- Timestamp:
- 08/24/03 17:26:24 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/Primitives.java
r3481 r3485 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Primitives.java,v 1.34 3 2003-08-24 16:23:22piso Exp $5 * $Id: Primitives.java,v 1.344 2003-08-24 17:26:24 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 4788 4788 } 4789 4789 }; 4790 4791 // ### realpart 4792 private static final Primitive1 REALPART = new Primitive1("realpart") 4793 { 4794 public LispObject execute(LispObject arg) throws LispError 4795 { 4796 if (arg instanceof Complex) 4797 return ((Complex)arg).getRealPart(); 4798 if ((arg.getType() & TYPE_NUMBER) != 0) 4799 return arg; 4800 throw new TypeError(arg, "number"); 4801 } 4802 }; 4803 4804 // ### imagpart 4805 private static final Primitive1 IMAGPART = new Primitive1("imagpart") 4806 { 4807 public LispObject execute(LispObject arg) throws LispError 4808 { 4809 if (arg instanceof Complex) 4810 return ((Complex)arg).getImaginaryPart(); 4811 return arg.multiplyBy(Fixnum.ZERO); 4812 } 4813 }; 4790 4814 }
Note: See TracChangeset
for help on using the changeset viewer.