From a37f958774bd0f7b1800a68a44492e4f95d26e8c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 15 Dec 2014 20:07:05 -0400 Subject: Added lambdas! (not yet real closures, but coming soon...) --- test2.lang | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'test2.lang') diff --git a/test2.lang b/test2.lang index e52e667d7..c8f2147ed 100644 --- a/test2.lang +++ b/test2.lang @@ -25,9 +25,16 @@ (def sample (#Tag "value")) (def (constant x y) - y) + x) (def (main args) (if true - (_. (_.. System out) (println ["TRUE" "YOLO"])) + (_. (_.. System out) (println ((lambda [x y] x) "TRUE" "YOLO"))) (_. (_.. System out) (println "FALSE")))) + +#( (let output ((lambda [x y] x) "TRUE" "YOLO") + (_. (_.. System out) (println output))) )# +#( (let f (lambda [x y] x) + (_. (_.. System out) (println (f "TRUE" "YOLO")))) )# +## ((lambda [x y] (_. (_.. System out) (println x))) "TRUE" "YOLO") +## (_. (_.. System out) (println ((lambda [x y] x) "TRUE" "YOLO"))) -- cgit v1.2.3