diff options
author | Eduardo Julian | 2014-12-19 14:30:25 -0400 |
---|---|---|
committer | Eduardo Julian | 2014-12-19 14:30:25 -0400 |
commit | e4bcdcda60fec97622217840d54ae9ee2c121f72 (patch) | |
tree | ce01388b7da921bbc0465358c94841b565d150b0 /test2.lang | |
parent | 8aa19bf2b8f6870779a04ba3782c60fd31655fa6 (diff) |
Almost finished implementing closures.
Diffstat (limited to '')
-rw-r--r-- | test2.lang | 19 |
1 files changed, 9 insertions, 10 deletions
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) |