/** Return a plist which has no value stored for INDICATOR in PLIST */ public final SubLList remf(SubLObject indicator) { // @todo get rid of duplication with conses_high...this version shoul prevail // @todo hand optimize this code SubLObject back = SubLNil.NIL; SubLObject next = SubLNil.NIL; SubLObject key = SubLNil.NIL; for (back = SubLNil.NIL, next = this, key = ConsesLow.car(next); (SubLNil.NIL == Types.sublisp_null(next)); back = ConsesLow.cdr(next), next = next.rest().rest(), key = ConsesLow.car(next)) { if ((indicator == key)) { if ((SubLNil.NIL != back)) { ConsesLow.rplacd(back, next.rest().rest()); return this; } else { return next.rest().rest().toList(); } } } return this; }
/** Replace the last cdr of NON-EMPTY-LIST with NEW-LAST-CDR */ @SubL(source = "cycl/subl-macros.lisp", position = 27221) public static final SubLObject rplacd_last(SubLObject non_empty_list, SubLObject new_last_cdr) { return ConsesLow.rplacd(conses_high.last(non_empty_list, UNPROVIDED), new_last_cdr); }