summaryrefslogtreecommitdiff
path: root/lib/bio/geti.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-09-30 22:18:21 -0700
committerOri Bernstein <ori@eigenstate.org>2017-09-30 22:18:21 -0700
commit8672ce0c95bf5d6e6b721694bd0e5944d4af556b (patch)
treead54ebc4603c410cd9eb0b2f07cf133a701ff185 /lib/bio/geti.myr
parent7cc7912b2834f9f5dde95412e5302f13fb82042c (diff)
downloadmc-8672ce0c95bf5d6e6b721694bd0e5944d4af556b.tar.gz
Replace bio.status(@t) with std.result(@t, bio.err)
It's more consistent.
Diffstat (limited to 'lib/bio/geti.myr')
-rw-r--r--lib/bio/geti.myr36
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/bio/geti.myr b/lib/bio/geti.myr
index 70186b2..3b6eb3e 100644
--- a/lib/bio/geti.myr
+++ b/lib/bio/geti.myr
@@ -4,34 +4,34 @@ use "bio"
pkg bio =
/* unsigned big endian */
- generic getbe8 : (f : file# -> status(@a::(numeric,integral)))
- generic getbe16 : (f : file# -> status(@a::(numeric,integral)))
- generic getbe32 : (f : file# -> status(@a::(numeric,integral)))
- generic getbe64 : (f : file# -> status(@a::(numeric,integral)))
+ generic getbe8 : (f : file# -> std.result(@a::(numeric,integral), err))
+ generic getbe16 : (f : file# -> std.result(@a::(numeric,integral), err))
+ generic getbe32 : (f : file# -> std.result(@a::(numeric,integral), err))
+ generic getbe64 : (f : file# -> std.result(@a::(numeric,integral), err))
/* signed big endian */
- generic getle8 : (f : file# -> status(@a::(numeric,integral)))
- generic getle16 : (f : file# -> status(@a::(numeric,integral)))
- generic getle32 : (f : file# -> status(@a::(numeric,integral)))
- generic getle64 : (f : file# -> status(@a::(numeric,integral)))
+ generic getle8 : (f : file# -> std.result(@a::(numeric,integral), err))
+ generic getle16 : (f : file# -> std.result(@a::(numeric,integral), err))
+ generic getle32 : (f : file# -> std.result(@a::(numeric,integral), err))
+ generic getle64 : (f : file# -> std.result(@a::(numeric,integral), err))
;;
/*
reads a single integer-like value to the output stream, in
little endian format
*/
-generic getle = {f, n -> status(@a::(numeric,integral))
+generic getle = {f, n -> std.result(@a::(numeric,integral), err)
var v, i
v = 0
match ensureread(f, n)
- | `Eof: -> `Eof
- | `Err e : -> `Err e
- | `Ok _:
+ | `std.Err e:
+ -> `std.Err e
+ | `std.Ok _:
for i = 0; i < n; i++
v |= (f.rbuf[f.rstart++] : uint64) << (8*(i : uint64))
;;
- -> `Ok (v : @a::(numeric,integral))
+ -> `std.Ok (v : @a::(numeric,integral))
;;
}
@@ -39,19 +39,19 @@ generic getle = {f, n -> status(@a::(numeric,integral))
reads a single integer-like value to the output stream, in
big endian format
*/
-generic getbe = {f, n -> status(@a::(numeric,integral))
+generic getbe = {f, n -> std.result(@a::(numeric,integral), err)
var v, i
v = 0
match ensureread(f, n)
- | `Eof: -> `Eof
- | `Err e : -> `Err e
- | `Ok _:
+ | `std.Err e:
+ -> `std.Err e
+ | `std.Ok _:
for i = 0; i < n; i++
v <<= 8
v |= (f.rbuf[f.rstart++] : uint64)
;;
- -> `Ok (v : @a::(numeric,integral))
+ -> `std.Ok (v : @a::(numeric,integral))
;;
}