[][src]Function parsley::proc_utils::make_binary_numeric

pub fn make_binary_numeric<T>(
    f: impl Fn(Num, Num) -> T + 'static,
    name: Option<&str>
) -> SExp where
    T: Into<SExp>, 

Make a procedure that takes two numeric arguments.

Note

The underlying numeric type is f64.

Example

use parsley::prelude::*;
use parsley::proc_utils::*;

let my_gte = |a, b| a >= b;

assert_eq!(
    Context::base().eval(
        sexp![make_binary_numeric(my_gte, None), 555, 444]
    ).unwrap(),
    SExp::from(true),
);