hcl/t/fun-01.hcl
hyung-hwan 4f8e7ae76e
Some checks failed
continuous-integration/drone/push Build is failing
added the 'fun' symbol as an alias to 'lamba'
2023-11-14 12:20:47 +09:00

24 lines
331 B
HCL

defun aaa(a b) {
| c |
set c (+ a b);
return c;
};
set k (aaa 10 20);
if (= k 30) { printf "OK\n"; }
else { printf "ERROR\n"; };
## --------------------------------------
defun mkfun(t) {
return (fun(c) {
return (+ t c);
});
};
set f (mkfun 20);
set k (f 50);
if (= k 50) { printf "OK\n"; }
else { printf "ERROR\n"; };