Changeset 4638


Ignore:
Timestamp:
11/04/03 01:42:26 (18 years ago)
Author:
piso
Message:

GET, SYS::%PUT

File:
1 edited

Legend:

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

    r4559 r4638  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Primitives.java,v 1.489 2003-10-28 16:02:31 piso Exp $
     5 * $Id: Primitives.java,v 1.490 2003-11-04 01:42:26 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    28392839    // ### get
    28402840    // get symbol indicator &optional default => value
    2841     private static final Primitive GET = new Primitive("get") {
    2842         public LispObject execute(LispObject[] args) throws ConditionThrowable
    2843         {
    2844             Symbol symbol;
    2845             LispObject indicator;
    2846             LispObject defaultValue;
    2847             switch (args.length) {
    2848                 case 2:
    2849                     symbol = checkSymbol(args[0]);
    2850                     indicator = args[1];
    2851                     defaultValue = NIL;
    2852                     break;
    2853                 case 3:
    2854                     symbol = checkSymbol(args[0]);
    2855                     indicator = args[1];
    2856                     defaultValue = args[2];
    2857                     break;
    2858                 default:
    2859                     throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
    2860             }
    2861             return get(symbol, indicator, defaultValue);
     2841    private static final Primitive GET = new Primitive("get")
     2842    {
     2843        public LispObject execute(LispObject symbol, LispObject indicator)
     2844            throws ConditionThrowable
     2845        {
     2846            return get(checkSymbol(symbol), indicator, NIL);
     2847        }
     2848        public LispObject execute(LispObject symbol, LispObject indicator,
     2849                                  LispObject defaultValue)
     2850            throws ConditionThrowable
     2851        {
     2852            return get(checkSymbol(symbol), indicator, defaultValue);
    28622853        }
    28632854    };
    28642855
    28652856    // ### %put
    2866     // %put symbol indicator value
    2867     private static final Primitive3 _PUT =
    2868         new Primitive3("%put", PACKAGE_SYS, false) {
    2869         public LispObject execute(LispObject first, LispObject second,
    2870             LispObject third) throws ConditionThrowable
    2871         {
    2872             Symbol symbol = checkSymbol(first);
    2873             LispObject indicator = second;
    2874             LispObject value = third;
    2875             return put(symbol, indicator, value);
     2857    // %put symbol indicator value => value
     2858    private static final Primitive3 _PUT = new Primitive3("%put", PACKAGE_SYS, false)
     2859    {
     2860        public LispObject execute(LispObject symbol, LispObject indicator,
     2861                                  LispObject value)
     2862            throws ConditionThrowable
     2863        {
     2864            return put(checkSymbol(symbol), indicator, value);
    28762865        }
    28772866    };
    28782867
    28792868    // ### macrolet
    2880     private static final SpecialOperator MACROLET =
    2881         new SpecialOperator("macrolet") {
     2869    private static final SpecialOperator MACROLET = new SpecialOperator("macrolet")
     2870    {
    28822871        public LispObject execute(LispObject args, Environment env)
    28832872            throws ConditionThrowable
     
    29182907
    29192908    // ### tagbody
    2920     private static final SpecialOperator TAGBODY =
    2921         new SpecialOperator("tagbody") {
     2909    private static final SpecialOperator TAGBODY = new SpecialOperator("tagbody")
     2910    {
    29222911        public LispObject execute(LispObject args, Environment env)
    29232912            throws ConditionThrowable
Note: See TracChangeset for help on using the changeset viewer.