Macro lamcal::app[][src]

macro_rules! app {
    ($term1:expr, $($term2:expr),+) => { ... };
}

Constructs a Term from a sequence of function applications.

The app! macro can be used to conveniently construct a Term from a sequence of function applications without all the nested calls of the app functions which would be the alternative way.

Examples

#[macro_use]
extern crate lamcal;
use lamcal::{app, lam, var};

let expr = app![
    lam("x", var("x")),
    lam("y", app!(var("x"), var("y"))),
    var("z")
];

assert_eq!(
    expr,
    app(
        app(lam("x", var("x")), lam("y", app(var("x"), var("y")))),
        var("z")
    )
);