diff options
author | Eduardo Julian | 2015-08-30 20:07:37 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-08-30 20:07:37 -0400 |
commit | a0533814cbc3b4b59850f97e9e72abc8bb83ff57 (patch) | |
tree | 5253a297c7b28c5881ba3845881115772e981cf1 /source | |
parent | 817d244adff361104ae0aa6ce53efe6c2bc07552 (diff) |
- Added call/cc to lux/codata/lazy.
- Added some minor compiler optimizations.
Diffstat (limited to 'source')
-rw-r--r-- | source/lux/codata/lazy.lux | 6 | ||||
-rw-r--r-- | source/lux/data/io.lux | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/source/lux/codata/lazy.lux b/source/lux/codata/lazy.lux index 1529c0dae..fb0c0bcb3 100644 --- a/source/lux/codata/lazy.lux +++ b/source/lux/codata/lazy.lux @@ -32,6 +32,12 @@ (-> (Lazy a) a)) (thunk id)) +(def #export (call/cc f) + (All [a b c] (Lazy (-> a (Lazy b c)) (Lazy a c))) + (lambda [k] + (f (lambda [a _] (k a)) + k))) + ## [Structs] (defstruct #export Lazy/Functor (Functor Lazy) (def (map f ma) diff --git a/source/lux/data/io.lux b/source/lux/data/io.lux index 2d2a2bc35..1ca68f518 100644 --- a/source/lux/data/io.lux +++ b/source/lux/data/io.lux @@ -42,10 +42,10 @@ ## [Functions] (def #export (print x) (-> Text (IO (,))) - (io (_jvm_invokevirtual "java.io.PrintStream" "print" ["java.lang.Object"] + (io (_jvm_invokevirtual "java.io.PrintStream" "print" ["java.lang.String"] (_jvm_getstatic "java.lang.System" "out") [x]))) (def #export (println x) (-> Text (IO (,))) - (io (_jvm_invokevirtual "java.io.PrintStream" "println" ["java.lang.Object"] + (io (_jvm_invokevirtual "java.io.PrintStream" "println" ["java.lang.String"] (_jvm_getstatic "java.lang.System" "out") [x]))) |