Changeset 4759


Ignore:
Timestamp:
11/15/03 00:26:12 (18 years ago)
Author:
piso
Message:

MACROEXPAND-1

File:
1 edited

Legend:

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

    r4727 r4759  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Primitives.java,v 1.495 2003-11-14 00:54:25 piso Exp $
     5 * $Id: Primitives.java,v 1.496 2003-11-15 00:26:12 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    23622362
    23632363    // ### macroexpand-1
    2364     private static final Primitive MACROEXPAND_1 =
    2365         new Primitive("macroexpand-1") {
    2366         public LispObject execute(LispObject[] args) throws ConditionThrowable
    2367         {
    2368             final int length = args.length;
    2369             if (length < 1 || length > 2)
    2370                 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
    2371             LispObject form = args[0];
    2372             final Environment env;
    2373             if (length == 2 && args[1] != NIL)
    2374                 env = checkEnvironment(args[1]);
    2375             else
    2376                 env = new Environment();
    2377             return macroexpand_1(form, env, LispThread.currentThread());
     2364    private static final Primitive MACROEXPAND_1 = new Primitive("macroexpand-1")
     2365    {
     2366        public LispObject execute(LispObject form) throws ConditionThrowable
     2367        {
     2368            return macroexpand_1(form,
     2369                                 new Environment(),
     2370                                 LispThread.currentThread());
     2371        }
     2372        public LispObject execute(LispObject form, LispObject env)
     2373            throws ConditionThrowable
     2374        {
     2375            return macroexpand_1(form,
     2376                                 env != NIL ? checkEnvironment(env) : new Environment(),
     2377                                LispThread.currentThread());
    23782378        }
    23792379    };
Note: See TracChangeset for help on using the changeset viewer.