Ignore:
Timestamp:
May 11, 2011, 1:13:42 PM (11 years ago)
Author:
Sam Hocevar
Message:

lisp: fix a confusion in the `assoc' lisp implementation usage, and
make it a LList method to avoid future breakage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/lisp/lisp.cpp

    r637 r638  
    846846}
    847847
    848 LObject *LObject::Assoc(LObject *item)
    849 {
    850     if (item_type(this) != L_CONS_CELL)
    851         return NULL;
    852 
    853     LObject *list = this;
    854     while (list)
     848LList *LList::Assoc(LObject *item)
     849{
     850    LList *list = this;
     851    while (list && item_type(list) == L_CONS_CELL
     852                && item_type(CAR(list)) == L_CONS_CELL)
    855853    {
    856854        if (lisp_eq(CAR(CAR(list)), item))
    857             return lcar(list);
    858         list = CDR(list);
     855            return (LList *)CAR(list);
     856        list = (LList *)CDR(list);
    859857    }
    860858
Note: See TracChangeset for help on using the changeset viewer.