Changeset 4277


Ignore:
Timestamp:
10/10/03 02:57:39 (19 years ago)
Author:
piso
Message:

MEMQ

File:
1 edited

Legend:

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

    r4274 r4277  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Extensions.java,v 1.14 2003-10-10 02:00:31 piso Exp $
     5 * $Id: Extensions.java,v 1.15 2003-10-10 02:57:39 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2626public final class Extensions extends Lisp
    2727{
     28    // memq item list &key key test test-not => tail
     29    private static final Primitive2 MEMQ =
     30        new Primitive2("memq", PACKAGE_EXT, true)
     31    {
     32        public LispObject execute(LispObject item, LispObject list)
     33            throws ConditionThrowable
     34        {
     35            LispObject tail = checkList(list);
     36            while (tail != NIL) {
     37                if (item == tail.car())
     38                    return tail;
     39                tail = tail.cdr();
     40            }
     41            return NIL;
     42        }
     43    };
     44
    2845    // ### special-variable-p
    2946    private static final Primitive1 SPECIAL_VARIABLE_P =
Note: See TracChangeset for help on using the changeset viewer.