// multiplication function - exposed as (*) to Lisp
multiplication function - exposed as (*) to Lisp
multiplication function - exposed as ( * ) to Lisp
pub fn mul(params: Vec<Rc<LispValue>>) -> EvalResult {
    params.into_iter()
        .fold(Ok(LispValue::Int(1)), |a, b| {
            match a {
                Ok(acc) => match (acc, b.deref()) {
                    (LispValue::Int(r), &LispValue::Int(a)) => Ok(LispValue::Int(r * a)),
                    (LispValue::Int(r), &LispValue::Float(a)) => Ok(LispValue::Float((r as f64) * a)),
                    (LispValue::Float(r), &LispValue::Int(a)) => Ok(LispValue::Float(r * (a as f64))),
                    (LispValue::Float(r), &LispValue::Float(a)) => Ok(LispValue::Float(r * a)),
                    (_, ref rb) => Err(format!("Wrong type: {}", rb))
                },
                Err(e) => Err(e)
            }
        })
        .map(|e| Rc::new(e))
}
pub fn mul ( params : Vec < Rc < LispValue > > ) -> EvalResult { params . into_iter ( ) . fold ( Ok ( LispValue :: Int ( 1 ) ) , | a , b | { match a { Ok ( acc ) => match ( acc , b . deref ( ) ) { ( LispValue :: Int ( r ) , & LispValue :: Int ( a ) ) => Ok ( LispValue :: Int ( r * a ) ) , ( LispValue :: Int ( r ) , & LispValue :: Float ( a ) ) => Ok ( LispValue :: Float ( ( r as f64 ) * a ) ) , ( LispValue :: Float ( r ) , & LispValue :: Int ( a ) ) => Ok ( LispValue :: Float ( r * ( a as f64 ) ) ) , ( LispValue :: Float ( r ) , & LispValue :: Float ( a ) ) => Ok ( LispValue :: Float ( r * a ) ) , ( _ , ref rb ) => Err ( format ! ( " " rb ) ) } , Err ( e ) => Err ( e ) } } ) . map ( | e | Rc :: new ( e ) ) }
multiplication function - exposed as (*) to Lisp
multiplication function - exposed as ( * ) to Lisp
params
Vec<Rc<LispValue>>