Macro lambda_types::call
source · macro_rules! call { ({$($wrapped: tt)+}) => { ... }; ($name: ty) => { ... }; ($name: ty , $arg: ty) => { ... }; ($name: ty , { $($arg: tt)+ } $($arg2: tt)*) => { ... }; ($name: ty , $arg: ty , $($arg2: tt)+) => { ... }; }
Expand description
Ergonomic wrapper macro for calling a function.
Calling syntax is modeled around the lambda calculus, where:
fx
is translated tof, x
f(...)
is translated tof, {...}
So, for example, ab(c(de)f)gh
translates to a, b, { c, { d, e }, f }, g, h
.
The whitespace isn’t mandatory, but is recommended for readibility (see: a,b{c,{d,e},f},g,h
).
This macro is hygienic.