diff options
Diffstat (limited to '')
-rw-r--r-- | test2.lang | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/test2.lang b/test2.lang index cbce36ce8..55d7a14af 100644 --- a/test2.lang +++ b/test2.lang @@ -1,5 +1,5 @@ (import java.lang.System) -## (require "./another" as another) +(require "./another" as another) (definterface Function (: apply (-> [java.lang.Object] java.lang.Object))) @@ -18,11 +18,19 @@ (#Cons x xs*) (#Cons x (++ xs* ys)))) )# +#( (def (main args) + (if true + (case (#Pair "Pattern" "Matching") + (#Pair first second) + (do (:: (:: System out) (println first)) + (:: (:: System out) (println second)))) + (:: (:: System out) (println "FALSE")))) )# + (def (main args) (if true - (let variant (#Pair "Pattern" "Matching") - (case variant - (#Pair first second) + (let xs+ys (#Cons "Pattern" (#Cons "Matching" #Nil)) + (case xs+ys + (#Cons first (#Cons second #Nil)) (do (:: (:: System out) (println first)) (:: (:: System out) (println second))))) (:: (:: System out) (println "FALSE")))) |