public static Shelisp.Object Feq(L l, Shelisp.Object o1, Shelisp.Object o2) { if (L.NILP(o1)) return L.NILP(o2) ? L.Qt : L.Qnil; return o1.LispEq (o2) ? L.Qt : L.Qnil; }
public static AssertResult Eq(Shelisp.Object o1, Shelisp.Object o2, string description = null) { try { return (!o1.LispEq (o2)) ? Fail(description) : Succeed(description); } catch (Exception e) { return FailException (e, description); } }
public static Shelisp.Object Memq(Shelisp.Object obj, Shelisp.Object alist) { Shelisp.Object tail = alist; do { if (obj.LispEq (L.CAR(tail))) return tail; tail = L.CDR(tail); } while (L.CONSP (tail)); return L.Qnil; }
public static Shelisp.Object Frassq(L l, Shelisp.Object key, Shelisp.Object alist) { if (!L.CONSP(alist)) return L.Qnil; //throw new WrongTypeArgumentException ("listp", alist); foreach (var el in L.CONS(alist)) { if (!L.LISTP(el)) continue; if (L.NILP(el)) break; var cdr = L.CDR(el); if (key.LispEq (cdr)) return el; } return L.Qnil; }
private static bool compare_eq(Shelisp.Object obj1, Shelisp.Object obj2, long hash1, long hash2) { return obj1.LispEq (obj2); }
public static AssertResult NotEq(Shelisp.Object o1, Shelisp.Object o2, string description = null) { return (o1.LispEq (o2)) ? Fail(description) : Succeed(description); }