From e4bcdcda60fec97622217840d54ae9ee2c121f72 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 19 Dec 2014 14:30:25 -0400 Subject: Almost finished implementing closures. --- test2.lang | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'test2.lang') diff --git a/test2.lang b/test2.lang index 5ff6eb196..e300ce256 100644 --- a/test2.lang +++ b/test2.lang @@ -22,25 +22,24 @@ (def const "IDENTITY") -(def sample (#Tag "value")) +(def variant (#Tag "value")) (def (constant x y) x) (def (main args) (if true - (do (_. (_.. System out) (println true)) - (_. (_.. System out) (println (another/id 12345))) - (_. (_.. System out) (println (constant "ONE" "TWO"))) - (_. (_.. System out) (println 2.3)) - (_. (_.. System out) (println #"Y")) - (_. (_.. System out) (println "this\tis a\nstring")) - (case (#Box "data") - (#Box value) - (_. (_.. System out) (println value)))) + (let output "IT WORKS!" + (_. (_.. System out) (println ((lambda [x y] output) "TRUE" "YOLO")))) (_. (_.. System out) (println "FALSE")))) +## Doesn't work yet... +#( (let output "IT WORKS!" + (_. (_.. System out) (println (((lambda [x] (lambda [y] output)) "TRUE") "YOLO")))) )# + ## All of these work :D +#( (let output "IT WORKS!" + (_. (_.. System out) (println ((lambda [x y] output) "TRUE" "YOLO")))) )# #( (let output ((lambda [x y] x) "TRUE" "YOLO") (_. (_.. System out) (println output))) )# #( (let f (lambda [x y] x) -- cgit v1.2.3