use std::ops::{Deref, DerefMut};
use crate::types::*;
-#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
-pub(crate) struct OrderedOpDirKey(pub(crate) Atom, pub(crate) Fixity);
// 7.2
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
}
}
- fn unify_big_num<N>(&mut self, n1: TypedArenaPtr<N>, value: HeapCellValue)
- where
- N: PartialEq<Rational> + PartialEq<Integer> + PartialEq<i64> + ArenaAllocated,
- {
- if let Some(r) = value.as_var() {
- Self::bind(self, r, typed_arena_ptr_as_cell!(n1));
- return;
- }
-
- match Number::try_from(value) {
- Ok(n2) => match n2 {
- Number::Fixnum(n2) if *n1 == n2.get_num() => {}
- Number::Integer(n2) if *n1 == *n2 => {}
- Number::Rational(n2) if *n1 == *n2 => {}
- _ => {
- self.fail = true;
- }
- },
- Err(_) => {
- self.fail = true;
- }
- }
- }
-
fn unify_big_integer(&mut self, n1: TypedArenaPtr<Integer>, value: HeapCellValue) {
if let Some(r) = value.as_var() {
Self::bind(self, r, typed_arena_ptr_as_cell!(n1));