aboutsummaryrefslogtreecommitdiff
path: root/source/lux/host/io.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/lux/host/io.lux10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/lux/host/io.lux b/source/lux/host/io.lux
index 4542b0519..99e15722d 100644
--- a/source/lux/host/io.lux
+++ b/source/lux/host/io.lux
@@ -30,11 +30,11 @@
(let [in (_jvm_getstatic "java.lang.System" "in")
reader (_jvm_new "java.io.InputStreamReader" ["java.io.InputStream"] [in])
buff-reader (_jvm_new "java.io.BufferedReader" ["java.io.Reader"] [reader])]
- (@io (let [output (: (Either Text <type>) (try <op>))]
- (exec (_jvm_invokeinterface "java.io.Closeable" "close" [] buff-reader [])
- (case output
- (#;Left _) #;None
- (#;Right input) (#;Some input)))))))]
+ (@io (let [output (: (Either Text <type>) (try <op>))
+ _close (: (Either Text (,)) (try (_jvm_invokeinterface "java.io.Closeable" "close" [] buff-reader [])))]
+ (case [output _close]
+ (\or [(#;Left _) _] [_ (#;Left _)]) #;None
+ [(#;Right input) (#;Right _)] (#;Some input))))))]
[read-char Char (_jvm_i2c (_jvm_invokevirtual "java.io.BufferedReader" "read" [] buff-reader []))]
[read-line Text (_jvm_invokevirtual "java.io.BufferedReader" "readLine" [] buff-reader [])]