arrow lambdas
This commit is contained in:
@@ -281,6 +281,10 @@ class BasicTestCase extends Test {
|
||||
function testKissStrings() {
|
||||
_testKissStrings();
|
||||
}
|
||||
|
||||
function testArrowLambdas() {
|
||||
_testArrowLambdas();
|
||||
}
|
||||
}
|
||||
|
||||
class BasicObject {
|
||||
|
@@ -466,4 +466,17 @@
|
||||
num 3
|
||||
l1 ["a" "b" "c"]
|
||||
l2 [1 2 3]]
|
||||
(Assert.equals "it's 3asy as [a,b,c] [1,2,3]" "$str ${num}asy as $l1 $l2")))
|
||||
(Assert.equals "it's 3asy as [a,b,c] [1,2,3]" "$str ${num}asy as $l1 $l2")))
|
||||
|
||||
(defun _testArrowLambdas []
|
||||
(let [withArgs
|
||||
->[arg1 arg2] (+ arg1 arg2)
|
||||
withArg
|
||||
->arg (* 2 arg)
|
||||
withoutArgs
|
||||
->{
|
||||
(+ 5)
|
||||
6}]
|
||||
(Assert.equals 11 (withArgs 5 6))
|
||||
(Assert.equals 12 (withArg 6))
|
||||
(Assert.equals 6 (withoutArgs))))
|
Reference in New Issue
Block a user