aboutsummaryrefslogtreecommitdiff
path: root/test2.lang
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test2.lang17
1 files changed, 11 insertions, 6 deletions
diff --git a/test2.lang b/test2.lang
index e300ce256..8f9b7c817 100644
--- a/test2.lang
+++ b/test2.lang
@@ -27,19 +27,24 @@
(def (constant x y)
x)
+(def (constant2 x)
+ (lambda [y] x))
+
(def (main args)
(if true
- (let output "IT WORKS!"
- (_. (_.. System out) (println ((lambda [x y] output) "TRUE" "YOLO"))))
+ (let f (lambda [x] (lambda [y] (x y)))
+ (let g (lambda [x] x)
+ (_. (_.. System out) (println (f g "WE'VE GOT CLOSURES!")))))
(_. (_.. 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 "IT WORKS!"
+ (let f (lambda [x] (lambda [y] output))
+ (_. (_.. System out) (println (f "TRUE" "YOLO"))))) )#
+#( (let output "IT WORKS!"
+ (_. (_.. System out) (println ((lambda [x] (lambda [y] output)) "TRUE" "YOLO")))) )#
#( (let output ((lambda [x y] x) "TRUE" "YOLO")
(_. (_.. System out) (println output))) )#
#( (let f (lambda [x y] x)