hsedit/examples/example1

18 lines
601 B
Text
Raw Normal View History

2016-08-13 10:30:15 +00:00
{
max = { % number a, number b, number c -> number or "error"
[ c = "" : c = "0"; ] % by default use "0" if c not specified
ab = {} + ("test " + a + " -le " + b).syscall;
[ ab = "1" :
ac = {} + ("test " + a + " -le " + c).syscall;
[ ac = "1" : ^c; ]
[ ac = "0" : ^a; ]
][ ab = "0" :
^ { a = *a; b = *c; c = *b; } + *max;
]
^ "error";
}
result = { a = "12"; b = "27"; c = "18"; } + max;
{} + ("echo " + result).syscall;
{} + ("echo " + ({ a = "-12"; b = "-27"; } + max)).syscall;
}