Changeset 5858


Ignore:
Timestamp:
02/16/04 19:59:52 (17 years ago)
Author:
piso
Message:

EMPTY-ENVIRONMENT-P

File:
1 edited

Legend:

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

    r5257 r5858  
    22 * Environment.java
    33 *
    4  * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Environment.java,v 1.10 2003-12-27 04:29:45 piso Exp $
     4 * Copyright (C) 2002-2004 Peter Graves
     5 * $Id: Environment.java,v 1.11 2004-02-16 19:59:52 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    183183        return unreadableString("ENVIRONMENT");
    184184    }
     185
     186    // ### empty-environment-p
     187    private static final Primitive1 EMPTY_ENVIRONMENT_P =
     188        new Primitive1("empty-environment-p", PACKAGE_SYS, false, "environment")
     189    {
     190        public LispObject execute(LispObject arg) throws ConditionThrowable
     191        {
     192            try {
     193                return ((Environment)arg).isEmpty() ? T : NIL;
     194            }
     195            catch (ClassCastException e) {
     196                return signal(new TypeError(String.valueOf(arg) + " is not an environment."));
     197            }
     198        }
     199    };
    185200}
Note: See TracChangeset for help on using the changeset viewer.