Changeset 4782


Ignore:
Timestamp:
11/16/03 15:32:58 (18 years ago)
Author:
piso
Message:

VALUES-LIST

File:
1 edited

Legend:

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

    r4780 r4782  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Primitives.java,v 1.498 2003-11-16 15:03:45 piso Exp $
     5 * $Id: Primitives.java,v 1.499 2003-11-16 15:32:58 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    7676    private static final int THIRD                      = 42;
    7777    private static final int UPPER_CASE_P               = 43;
    78     private static final int VALUES_LIST                = 44;
    79     private static final int VECTORP                    = 45;
     78    private static final int VECTORP                    = 44;
    8079
    8180    // Primitive2
    82     private static final int MEMBER                     = 46;
    83     private static final int RPLACA                     = 47;
    84     private static final int RPLACD                     = 48;
    85     private static final int SET                        = 49;
     81    private static final int MEMBER                     = 45;
     82    private static final int RPLACA                     = 46;
     83    private static final int RPLACD                     = 47;
     84    private static final int SET                        = 48;
    8685
    8786    private Primitives()
     
    131130        definePrimitive1("third", THIRD);
    132131        definePrimitive1("upper-case-p", UPPER_CASE_P);
    133         definePrimitive1("values-list", VALUES_LIST);
    134132        definePrimitive1("vectorp", VECTORP);
    135133
     
    302300            case PREDECESSOR:                   // ### 1-
    303301                return arg.decr();
    304             case VALUES_LIST:                   // ### values-list
    305                 return values(arg.copyToArray());
    306302            case EVAL:                          // ### eval
    307303                return eval(arg, new Environment(), LispThread.currentThread());
     
    405401    };
    406402
     403    // ### values-list
     404    // values-list list => element*
     405    // Returns the elements of the list as multiple values.
     406    private static final Primitive1 VALUES_LIST = new Primitive1("values-list")
     407    {
     408        public LispObject execute(LispObject arg) throws ConditionThrowable
     409        {
     410            return LispThread.currentThread().setValues(arg.copyToArray());
     411        }
     412    };
     413
    407414    // ### cons
    408415    private static final Primitive2 CONS = new Primitive2("cons") {
     
    432439
    433440    // ### constantp
    434     private static final Primitive CONSTANTP = new Primitive("constantp") {
     441    private static final Primitive CONSTANTP = new Primitive("constantp")
     442    {
    435443        public LispObject execute(LispObject arg) throws ConditionThrowable
    436444        {
    437445            return arg.CONSTANTP();
    438446        }
    439         public LispObject execute(LispObject first, LispObject second) throws ConditionThrowable
     447        public LispObject execute(LispObject first, LispObject second)
     448            throws ConditionThrowable
    440449        {
    441450            return first.CONSTANTP();
Note: See TracChangeset for help on using the changeset viewer.