pub fn update_to_functor(&mut self, var: VarId, name: Spur, arity: usize) {
        let next_var = &mut self.next_var;
        let map = &mut self.map;
        // SAFETY: see `new_var_of_functor`
        unsafe {
            let args = Self::alloc_functor_args(
                &self.arena,
                (0..arity).map(|_| {
                    let new_var = VarId(*next_var);
                    map.insert(new_var, Item::Unresolved);
                    *next_var += 1;
                    new_var
                }),
            );
            let item = Item::Functor { name, args };
            self.update(var, item)
        }
    }
/// Resolves the variable to a new functor, with the given name and arity
/// Used by functor/3
Resolves the variable to a new functor, with the given name and arity
Used by functor/3
Resolves the variable to a new functor with the given name and arity Used by functor / 3
pub fn update_to_functor(&mut self, var: VarId, name: Spur, arity: usize) {
        let next_var = &mut self.next_var;
        let map = &mut self.map;
        // SAFETY: see `new_var_of_functor`
        unsafe {
            let args = Self::alloc_functor_args(
                &self.arena,
                (0..arity).map(|_| {
                    let new_var = VarId(*next_var);
                    map.insert(new_var, Item::Unresolved);
                    *next_var += 1;
                    new_var
                }),
            );
            let item = Item::Functor { name, args };
            self.update(var, item)
        }
    }
pub fn update_to_functor ( & mut self , var : VarId , name : Spur , arity : usize ) { let next_var = & mut self . next_var ; let map = & mut self . map ; // SAFETY: see `new_var_of_functor` unsafe { let args = Self :: alloc_functor_args ( & self . arena , ( 0 .. arity ) . map ( | _ | { let new_var = VarId ( * next_var ) ; map . insert ( new_var , Item :: Unresolved ) ; * next_var += 1 ; new_var } ) , ) ; let item = Item :: Functor { name , args } ; self . update ( var , item ) } }
Resolves the variable to a new functor, with the given name and arity
Used by functor/3
Resolves the variable to a new functor with the given name and arity Used by functor / 3
&mut self
var
VarId
name
Spur
arity
usize
&mut self
var
VarId
name
Spur
arity
usize