aboutsummaryrefslogtreecommitdiffstats
path: root/test/scripts/try1.milch
diff options
context:
space:
mode:
Diffstat (limited to 'test/scripts/try1.milch')
-rw-r--r--test/scripts/try1.milch8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/scripts/try1.milch b/test/scripts/try1.milch
new file mode 100644
index 0000000..32abba2
--- /dev/null
+++ b/test/scripts/try1.milch
@@ -0,0 +1,8 @@
+(import "core/common")
+(import "core/result")
+
+(let safe-read-file! (Result/safe! read-file!))
+
+; calls read-file! and wraps the result in a Result/ok on success
+; in case of error, calls Result/ex on the error string
+(safe-read-file! "does-not-exist.txt")