ucg/std/functional.ucg
Jeremy Wall 890387b4cc FEATURE: Macros are just an expression now.
This is a breaking change for the map, filter, and reduce expressions
but happily a forward compatible change for macros themselves.
2019-01-16 19:27:58 -06:00

17 lines
308 B
Plaintext

let maybe = module{
val = NULL,
} => {
let do = macro(op) => select (mod.val != NULL), NULL, {
true = op(mod.val),
};
};
let if = module{
test = false,
} => {
let do = macro(op, arg) => select mod.test, arg, {
true = op(arg),
};
};
let identity = macro(arg) => arg;