pub(super)
    fn check_keysort_errors(&self) -> CallResult {
        let stub = MachineError::functor_stub(clause_name!("keysort"), 2);

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

        match self.detect_cycles(pairs.clone()) {
            CycleSearchResult::PartialList(..) => {
                Err(self.error_form(MachineError::instantiation_error(), stub))
            }
            CycleSearchResult::NotList => {
                Err(self.error_form(MachineError::type_error(0, ValidType::List, pairs), stub))
            }
            _ => 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(&self) -> CallResult {
        let stub = MachineError::functor_stub(clause_name!("keysort"), 2);
        let pairs  = self.store(self.deref(self[temp_v!(1)].clone()));
        let sorted = self.store(self.deref(self[temp_v!(2)].clone()));
        match self.detect_cycles(pairs.clone()) {
            CycleSearchResult::PartialList(..) => {
                Err(self.error_form(MachineError::instantiation_error(), stub))
            }
            CycleSearchResult::NotList => {
                Err(self.error_form(MachineError::type_error(0, ValidType::List, pairs), stub))
            }
            _ => Ok(()),
        }?;
        self.check_for_list_pairs(sorted)
    }
pub ( super ) fn check_keysort_errors ( & self ) -> CallResult { let stub = MachineError :: functor_stub ( clause_name ! ( " " ) , 2 ) ; let pairs = self . store ( self . deref ( self [ temp_v ! ( 1 ) ] . clone ( ) ) ) ; let sorted = self . store ( self . deref ( self [ temp_v ! ( 2 ) ] . clone ( ) ) ) ; match self . detect_cycles ( pairs . clone ( ) ) { CycleSearchResult :: PartialList ( .. ) => { Err ( self . error_form ( MachineError :: instantiation_error ( ) , stub ) ) } CycleSearchResult :: NotList => { Err ( self . error_form ( MachineError :: type_error ( 0 , ValidType :: List , pairs ) , stub ) ) } _ => 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 .
&self
&self