add callable is/2

This commit is contained in:
Mark Thom
2018-01-19 00:08:55 -07:00
parent 1b402b2673
commit f9b53856ac
8 changed files with 353 additions and 247 deletions

View File

@@ -80,13 +80,13 @@ pub struct ArithmeticEvaluator<'a> {
pub trait ArithmeticTermIter<'a> {
type Iter : Iterator<Item=Result<ArithTermRef<'a>, ArithmeticError>>;
fn iter(&self) -> Result<Self::Iter, ArithmeticError>;
fn iter(self) -> Result<Self::Iter, ArithmeticError>;
}
impl<'a> ArithmeticTermIter<'a> for &'a Term {
type Iter = ArithInstructionIterator<'a>;
fn iter(&self) -> Result<Self::Iter, ArithmeticError> {
fn iter(self) -> Result<Self::Iter, ArithmeticError> {
ArithInstructionIterator::new(self)
}
}
@@ -223,3 +223,4 @@ impl<'a> ArithmeticEvaluator<'a>
Ok((code, self.interm.pop()))
}
}