diff --git a/README.md b/README.md index 2688c76..0978c8f 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ If that function is defined, you can do things like that: ```clojure (println* &(using (Result.unsafe-from-success (File.open "example")) f - &(File.read-all &f))) + (the (Result String String) (File.read-all &f)))) ``` The file that was opened will be automatically closed once the scope is exited. diff --git a/examples/file.carp b/examples/file.carp index b1c1ae2..847ddde 100644 --- a/examples/file.carp +++ b/examples/file.carp @@ -1,11 +1,11 @@ (load "main.carp") -(load "git@github.com:carpentry-org/file.git@master") +(load "git@github.com:carpentry-org/file.git@0.3.0") (implements close File.close) (defn main [] (println* - &(using-do (Result.unsafe-from-success (File.open "example")) f + &(using-do (Result.unsafe-from-success (File.open-with "example" "w+")) f (ignore (File.write &f "hi")) (File.rewind &f) - (File.read &f 2)))) + (the (Result String String) (File.read &f 2)))))