added a double lambda test case
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2024-03-09 14:16:51 +09:00
parent 49ad657544
commit 081c6d1874
3 changed files with 25 additions and 8 deletions

View File

@ -18,7 +18,16 @@ defun mkfun(t) {
return (fun(c) {
return (+ t c);
});
};
}
defun mkfund(t) {
return {fun(c) {
return (fun(d) {
##return (d + c t) ## this causes assertion failure.
return (d + c t)
})
}}
}
f := (mkfun 20);
set k (f 50);
@ -38,7 +47,9 @@ if (k = 50) {
};
k := {
(mkfun 20) 30
## the return value of this expression is ignored
(mkfun 20) 30 ## having comment here cause an issue...
## the return value of this expression is the return value of the block expression
(mkfun 20) 40
}
if (k = 60) {
@ -47,6 +58,12 @@ if (k = 60) {
printf "ERROR - %d\n" k
};
k := (((mkfund 10) 40) 30)
if (k = 80) {
printf "OK - %d\n" k
} else {
printf "ERROR - %d\n" k
};
## --------------------------------------
defclass A | a b c | {

View File

@ -1,5 +1,6 @@
#!/bin/sh
## use a subshell to execute the actual program in case the
## program crashes or exits without an error message.
echo RUN "[$@]"
($@ 2>&1 || echo "ERROR: exited with $?") | grep -E '^ERROR:' && exit 1
exit 0