mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
This is a breaking change for the map, filter, and reduce expressions but happily a forward compatible change for macros themselves.
17 lines
308 B
Plaintext
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; |