162163164165166167168169170171172173
return new ETuple2(res, acc); } @BIF public static ESeq reverse(EObject hd, EObject tl) { ESeq res = tl.testSeq(); ESeq front = hd.testSeq(); if (res == null) throw ERT.badarg(hd, tl); return reverse(front, res); }
181182183184185186187188189190191192193194195
return res; } @BIF public static EAtom member(EObject e, EObject l) { ESeq list = l.testSeq(); if (list == null) throw ERT.badarg(e, l); while (!list.isNil()) { if (e.equals(list.head())) return ERT.TRUE; list = list.tail(); } return ERT.FALSE; }