countingLambda

This commit is contained in:
2021-11-14 13:54:32 -07:00
parent c4106eed90
commit bb28737e61
5 changed files with 55 additions and 6 deletions

View File

@@ -317,6 +317,10 @@ class BasicTestCase extends Test {
function testClamp() {
_testClamp();
}
function testCountingLambda() {
_testCountingLambda();
}
}
class BasicObject {

View File

@@ -560,4 +560,14 @@
(Assert.equals 10 (clamp bigValue 5 10))
(Assert.equals 10 bigValue)
(Assert.equals 5 (clamp smallValue 5 10))
(Assert.equals 5 smallValue)))
(Assert.equals 5 smallValue)))
(function _testCountingLambda []
(let [fullSyntax
(countingLambda a [] a)
arrowSyntax
-+>b {b}]
(Assert.equals 1 (fullSyntax))
(Assert.equals 2 (fullSyntax))
(Assert.equals 1 (arrowSyntax))
(Assert.equals 2 (arrowSyntax))))