Changeset 3612


Ignore:
Timestamp:
09/08/03 02:35:47 (19 years ago)
Author:
piso
Message:

COMPLEX: single argument case.

File:
1 edited

Legend:

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

    r3591 r3612  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Primitives.java,v 1.373 2003-09-06 17:15:32 piso Exp $
     5 * $Id: Primitives.java,v 1.374 2003-09-08 02:35:47 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    47614761    // ### complex
    47624762    private static final Primitive2 COMPLEX = new Primitive2("complex") {
     4763        public LispObject execute(LispObject arg) throws LispError
     4764        {
     4765            if (arg instanceof LispFloat)
     4766                return Complex.getInstance(arg, LispFloat.ZERO);
     4767            if ((arg.getType() & TYPE_REAL) != 0)
     4768                return arg;
     4769            throw new TypeError(arg, "real number");
     4770        }
    47634771        public LispObject execute(LispObject first, LispObject second)
    47644772            throws LispError
Note: See TracChangeset for help on using the changeset viewer.