fn cmp_terms_primary(a: LTerm, b: LTerm, exact: bool) -> EqResult {
  let a_val = a.raw();
  let a_prim_tag = primary::get_tag(a_val);

  let b_val = b.raw();
  let b_prim_tag = primary::get_tag(b_val);
  if b_prim_tag != a_prim_tag {
    // different primary types, compare their classes
    // This can be optimized a little but is there any value in optimization?
    return EqResult::Concluded(cmp_type_order(a, b));
  }

  match a_prim_tag {
    primary::TAG_IMMED => {
      EqResult::Concluded(cmp_terms_immed(a, b, exact))
    },
    primary::TAG_CONS => unsafe {
      cmp_cons(a, b)
    },
    primary::TAG_BOX => {
      cmp_terms_box(a, b)
    },
    _ => panic!("Primary tag {} eq_terms unsupported", a_prim_tag)
  }
}
/// Switch between comparisons for equality by primary tag (immediate or boxes
/// or fail immediately for different primary tags).
Switch between comparisons for equality by primary tag (immediate or boxes
or fail immediately for different primary tags).
Switch between comparisons for equality by primary tag ( immediate or boxes or fail immediately for different primary tags ) .
fn cmp_terms_primary(a: LTerm, b: LTerm, exact: bool) -> EqResult {
  let a_val = a.raw();
  let a_prim_tag = primary::get_tag(a_val);
  let b_val = b.raw();
  let b_prim_tag = primary::get_tag(b_val);
  if b_prim_tag != a_prim_tag {
    // different primary types, compare their classes
    // This can be optimized a little but is there any value in optimization?
    return EqResult::Concluded(cmp_type_order(a, b));
  }
  match a_prim_tag {
    primary::TAG_IMMED => {
      EqResult::Concluded(cmp_terms_immed(a, b, exact))
    },
    primary::TAG_CONS => unsafe {
      cmp_cons(a, b)
    },
    primary::TAG_BOX => {
      cmp_terms_box(a, b)
    },
    _ => panic!("Primary tag {} eq_terms unsupported", a_prim_tag)
  }
}
fn cmp_terms_primary ( a : LTerm , b : LTerm , exact : bool ) -> EqResult { let a_val = a . raw ( ) ; let a_prim_tag = primary :: get_tag ( a_val ) ; let b_val = b . raw ( ) ; let b_prim_tag = primary :: get_tag ( b_val ) ; if b_prim_tag != a_prim_tag { // different primary types, compare their classes // This can be optimized a little but is there any value in optimization? return EqResult :: Concluded ( cmp_type_order ( a , b ) ) ; } match a_prim_tag { primary :: TAG_IMMED => { EqResult :: Concluded ( cmp_terms_immed ( a , b , exact ) ) } , primary :: TAG_CONS => unsafe { cmp_cons ( a , b ) } , primary :: TAG_BOX => { cmp_terms_box ( a , b ) } , _ => panic ! ( " " a_prim_tag ) } }
Switch between comparisons for equality by primary tag (immediate or boxes
or fail immediately for different primary tags).
Switch between comparisons for equality by primary tag ( immediate or boxes or fail immediately for different primary tags ) .
a
LTerm
b
LTerm
exact
bool