pub fn interpret(space: GroundingSpace, expr: &Atom) -> Result<Vec<Atom>, String> {
    let mut step = interpret_init(space, expr);
    while step.has_next() {
        step = interpret_step(step);
    }
    match step {
        StepResult::Return(mut result) => Ok(result.drain(0..)
            .map(|InterpretedAtom(atom, _)| atom).collect()),
        StepResult::Error(message) => Err(message),
        _ => panic!("Not expected step result: {:?}", step),
    }
}
/// Interpret passed atom and return a new plan, result or error. This function
/// blocks until result is calculated. For step by step interpretation one
/// should use [interpret_init] and [interpret_step] functions.
/// # Arguments
/// * `space` - atomspace to query for interpretation
/// * `expr` - atom to interpret
Interpret passed atom and return a new plan, result or error. This function
blocks until result is calculated. For step by step interpretation one
should use [interpret_init] and [interpret_step] functions.
Interpret passed atom and return a new plan result or error . This function blocks until result is calculated . For step by step interpretation one should use [ interpret_init ] and [ interpret_step ] functions .
pub fn interpret(space: GroundingSpace, expr: &Atom) -> Result<Vec<Atom>, String> {
    let mut step = interpret_init(space, expr);
    while step.has_next() {
        step = interpret_step(step);
    }
    match step {
        StepResult::Return(mut result) => Ok(result.drain(0..)
            .map(|InterpretedAtom(atom, _)| atom).collect()),
        StepResult::Error(message) => Err(message),
        _ => panic!("Not expected step result: {:?}", step),
    }
}
pub fn interpret ( space : GroundingSpace , expr : & Atom ) -> Result < Vec < Atom > , String > { let mut step = interpret_init ( space , expr ) ; while step . has_next ( ) { step = interpret_step ( step ) ; } match step { StepResult :: Return ( mut result ) => Ok ( result . drain ( 0 .. ) . map ( | InterpretedAtom ( atom , _ ) | atom ) . collect ( ) ) , StepResult :: Error ( message ) => Err ( message ) , _ => panic ! ( " " step ) , } }
Interpret passed atom and return a new plan, result or error.
Interpret passed atom and return a new plan result or error .
space
GroundingSpace
expr
&Atom
space
GroundingSpace
expr
&Atom