make doFor return null to avoid 'variables of type Void' error

This commit is contained in:
2021-06-27 22:41:58 -06:00
parent 7fef6b9533
commit a5ec577a7d

View File

@@ -225,7 +225,9 @@ class SpecialForms {
return EFor(EBinop(OpIn, loopVarExpr, k.convert(listExp)).withMacroPosOf(wholeExp), k.convert(body)).withMacroPosOf(wholeExp);
}
map["doFor"] = forExpr.bind("doFor");
map["doFor"] = (wholeExp:ReaderExp, args:Array<ReaderExp>, k:KissState) -> {
EBlock([forExpr("doFor", wholeExp, args, k), macro null]).withMacroPosOf(wholeExp);
};
map["for"] = (wholeExp:ReaderExp, args:Array<ReaderExp>, k:KissState) -> {
EArrayDecl([forExpr("for", wholeExp, args, k)]).withMacroPosOf(wholeExp);
};