pub(super) fn check_keysort_errors(&mut self) -> CallResult {
        let stub_gen = || functor_stub(atom!("keysort"), 2);

        let pairs = self.store(self.deref(self[temp_v!(1)]));
        let sorted = self.store(self.deref(self[temp_v!(2)]));

        match BrentAlgState::detect_cycles(&self.heap, pairs) {
            CycleSearchResult::PartialList(..) => {
                let err = self.instantiation_error();
                Err(self.error_form(err, stub_gen()))
            }
            CycleSearchResult::NotList(..) | CycleSearchResult::Cyclic(_) => {
                let err = self.type_error(ValidType::List, pairs);
                Err(self.error_form(err, stub_gen()))
            }
            _ => Ok(()),
        }?;

        self.check_for_list_pairs(sorted)
    }
// see 8.4.4 of Draft Technical Corrigendum 2.
see 8.4.4 of Draft Technical Corrigendum 2.
see 8 . 4 . 4 of Draft Technical Corrigendum 2 .
pub(super) fn check_keysort_errors(&mut self) -> CallResult {
        let stub_gen = || functor_stub(atom!("keysort"), 2);
        let pairs = self.store(self.deref(self[temp_v!(1)]));
        let sorted = self.store(self.deref(self[temp_v!(2)]));
        match BrentAlgState::detect_cycles(&self.heap, pairs) {
            CycleSearchResult::PartialList(..) => {
                let err = self.instantiation_error();
                Err(self.error_form(err, stub_gen()))
            }
            CycleSearchResult::NotList(..) | CycleSearchResult::Cyclic(_) => {
                let err = self.type_error(ValidType::List, pairs);
                Err(self.error_form(err, stub_gen()))
            }
            _ => Ok(()),
        }?;
        self.check_for_list_pairs(sorted)
    }
pub ( super ) fn check_keysort_errors ( & mut self ) -> CallResult { let stub_gen = | | functor_stub ( atom ! ( " " ) , 2 ) ; let pairs = self . store ( self . deref ( self [ temp_v ! ( 1 ) ] ) ) ; let sorted = self . store ( self . deref ( self [ temp_v ! ( 2 ) ] ) ) ; match BrentAlgState :: detect_cycles ( & self . heap , pairs ) { CycleSearchResult :: PartialList ( .. ) => { let err = self . instantiation_error ( ) ; Err ( self . error_form ( err , stub_gen ( ) ) ) } CycleSearchResult :: NotList ( .. ) | CycleSearchResult :: Cyclic ( _ ) => { let err = self . type_error ( ValidType :: List , pairs ) ; Err ( self . error_form ( err , stub_gen ( ) ) ) } _ => Ok ( ( ) ) , } ? ; self . check_for_list_pairs ( sorted ) }
see 8.4.4 of Draft Technical Corrigendum 2.
see 8 . 4 . 4 of Draft Technical Corrigendum 2 .
&mut self
&mut self