[][src]Macro ketos::ketos_closure

macro_rules! ketos_closure {
    ( $scope:expr, $name:expr, || -> $res:ty $code:block ) => { ... };
    ( $scope:expr, $name:expr, | $( $arg:ident : $arg_ty:ty ),* | -> $res:ty $code:block ) => { ... };
}

Similar to ketos_fn, this is a convenience macro fo redefining foreign functions, with automatic conversion between rust and ketos values. The difference is that this takes a closure instead.

This function is added to the given scope with the given name.

This example is not tested
ketos_closure!(scope, "my-fn", |a: &str| -> String { ... })