mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
23 lines
406 B
Plaintext
23 lines
406 B
Plaintext
|
let maybe = module{
|
||
|
val = NULL,
|
||
|
} => {
|
||
|
let do = macro(op) => {
|
||
|
result = select (mod.val != NULL), NULL, {
|
||
|
true = op(mod.val).result,
|
||
|
}
|
||
|
};
|
||
|
};
|
||
|
|
||
|
let if = module{
|
||
|
test = false,
|
||
|
} => {
|
||
|
let do = macro(op, arg) => {
|
||
|
result = select mod.test, arg, {
|
||
|
true = op(arg).result,
|
||
|
},
|
||
|
};
|
||
|
};
|
||
|
|
||
|
let identity = macro(arg) => {
|
||
|
result = arg,
|
||
|
};
|