Changeset 638
- Timestamp:
- May 11, 2011, 1:13:42 PM (11 years ago)
- Location:
- abuse/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/chars.cpp
r636 r638 337 337 if (f==l_abil) 338 338 { 339 L Object *l =CDR(CAR(field));339 LList *l = (LList *)CDR(CAR(field)); 340 340 PtrRef r4(l); 341 341 for (i=0; i<TOTAL_ABILITIES; i++) 342 342 { 343 Cell *ab = LSymbol::FindOrCreate(ability_names[i])->Assoc(l);343 Cell *ab = l->Assoc(LSymbol::FindOrCreate(ability_names[i])); 344 344 PtrRef r5(ab); 345 345 if (!NILP(ab)) … … 348 348 } else if (f==l_funs) 349 349 { 350 L Object *l =CDR(CAR(field));350 LList *l = (LList *)CDR(CAR(field)); 351 351 PtrRef r4(l); 352 352 for (i=0; i<TOTAL_OFUNS; i++) 353 353 { 354 Cell *ab = LSymbol::FindOrCreate(ofun_names[i])->Assoc(l);354 Cell *ab = l->Assoc(LSymbol::FindOrCreate(ofun_names[i])); 355 355 PtrRef r5(ab); 356 356 if (!NILP(ab) && lcar(lcdr(ab))) … … 359 359 } else if (f==l_flags) 360 360 { 361 L Object *l =CDR(CAR(field));361 LList *l = (LList *)CDR(CAR(field)); 362 362 PtrRef r4(l); 363 363 for (i=0; i<TOTAL_CFLAGS; i++) 364 364 { 365 365 366 Cell *ab = LSymbol::FindOrCreate(cflag_names[i])->Assoc(l);366 Cell *ab = l->Assoc(LSymbol::FindOrCreate(cflag_names[i])); 367 367 PtrRef r5(ab); 368 368 if (!NILP(ab) && lcar(lcdr(ab))->Eval()) … … 457 457 458 458 459 Cell *mrph = l_morph->Assoc(desc); // check for morph info459 Cell *mrph = desc->Assoc(l_morph); // check for morph info 460 460 morph_power=0; 461 461 if (!NILP(mrph)) … … 466 466 } else morph_mask=-1; 467 467 468 Cell *sa = l_state_art->Assoc(desc);468 Cell *sa = desc->Assoc(l_state_art); 469 469 if (NILP(sa)) 470 470 { … … 485 485 } 486 486 487 Cell *range = l_range->Assoc(desc);487 Cell *range = desc->Assoc(l_range); 488 488 if (!NILP(range)) 489 489 { … … 499 499 500 500 501 Cell *mf = l_fields->Assoc(desc);501 Cell *mf = desc->Assoc(l_fields); 502 502 if (!NILP(mf)) 503 503 { … … 513 513 if (find<0) 514 514 { 515 lprint( l_fields->Assoc(desc));515 lprint(desc->Assoc(l_fields)); 516 516 printf("fields : no such var name \"%s\"\n",name); 517 517 printf("current possiblities are : \n"); … … 530 530 531 531 532 Cell *lg = l_logo->Assoc(desc);532 Cell *lg = desc->Assoc(l_logo); 533 533 if (NILP(lg)) 534 534 { -
abuse/trunk/src/lisp/lisp.cpp
r637 r638 846 846 } 847 847 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) 848 LList *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) 855 853 { 856 854 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); 859 857 } 860 858 -
abuse/trunk/src/lisp/lisp.h
r636 r638 66 66 /* Methods */ 67 67 LObject *Eval(); 68 LObject *Assoc(LObject *item);69 68 void Print(); 70 69 … … 89 88 /* Methods */ 90 89 size_t GetLength(); 90 LList *Assoc(LObject *item); 91 91 92 92 /* Members */
Note: See TracChangeset
for help on using the changeset viewer.