summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-02-04 23:00:27 -0800
committerOri Bernstein <ori@eigenstate.org>2017-02-04 23:00:27 -0800
commit545d75324d8ad1d9f8f9977b0911e8e9e0704674 (patch)
tree9be767627108edab0ce0833e5b5a308eaafc8ab0 /lib
parentd6bd40e37b085aec922c6bb56e867e85a6c36982 (diff)
downloadmc-545d75324d8ad1d9f8f9977b0911e8e9e0704674.tar.gz
Ucons are now prefix expressions.
It's just what it looks like. This cleans up taking the address of union literals.
Diffstat (limited to 'lib')
-rw-r--r--lib/date/zoneinfo+posixy.myr2
-rw-r--r--lib/std/fltparse.myr8
-rw-r--r--lib/std/readall.myr2
-rw-r--r--lib/std/syswrap+posixy.myr2
-rw-r--r--lib/std/test/search.myr4
5 files changed, 9 insertions, 9 deletions
diff --git a/lib/date/zoneinfo+posixy.myr b/lib/date/zoneinfo+posixy.myr
index 76cb025..26aa916 100644
--- a/lib/date/zoneinfo+posixy.myr
+++ b/lib/date/zoneinfo+posixy.myr
@@ -71,7 +71,7 @@ const findtzoff = {tz, tm -> std.option(date.duration)
;;
ds = zone.ttinfo[zone.timetype[i]].gmtoff
free(zone)
- -> `std.Some (ds : date.duration) * 1_000_000
+ -> `std.Some ((ds : date.duration) * 1_000_000)
}
const load = {file
diff --git a/lib/std/fltparse.myr b/lib/std/fltparse.myr
index ff9a053..fcc97af 100644
--- a/lib/std/fltparse.myr
+++ b/lib/std/fltparse.myr
@@ -27,8 +27,8 @@ const flt64parse = {str
match fltparse(str)
| `Badflt: -> `std.None
- | `Inf sign: -> `std.Some (sign : flt64) * std.flt64inf()
- | `Nan sign: -> `std.Some (sign : flt64) * std.flt64nan()
+ | `Inf sign: -> `std.Some ((sign : flt64) * std.flt64inf())
+ | `Nan sign: -> `std.Some ((sign : flt64) * std.flt64nan())
| `Flt (sign, mant, exp):
val = toflt(sign, mant, exp, &lim64)
std.bigfree(mant)
@@ -41,8 +41,8 @@ const flt32parse = {str
match fltparse(str)
| `Badflt: -> `std.None
- | `Inf sign: -> `std.Some (sign : flt32) * std.flt32inf()
- | `Nan sign: -> `std.Some (sign : flt32) * std.flt32nan()
+ | `Inf sign: -> `std.Some ((sign : flt32) * std.flt32inf())
+ | `Nan sign: -> `std.Some ((sign : flt32) * std.flt32nan())
| `Flt (sign, mant, exp):
val = toflt(sign, mant, exp, &lim32)
std.bigfree(mant)
diff --git a/lib/std/readall.myr b/lib/std/readall.myr
index 68c930e..4f7d1da 100644
--- a/lib/std/readall.myr
+++ b/lib/std/readall.myr
@@ -22,5 +22,5 @@ const readall = {fd, dst
-> `Err e
;;
;;
- -> `Ok sz - dst.len
+ -> `Ok (sz - dst.len)
}
diff --git a/lib/std/syswrap+posixy.myr b/lib/std/syswrap+posixy.myr
index 2e8474d..e930e0f 100644
--- a/lib/std/syswrap+posixy.myr
+++ b/lib/std/syswrap+posixy.myr
@@ -156,7 +156,7 @@ const fmtime = {path
if r >= 0
sec = (sb.mtime.sec : time)
nsec = (sb.mtime.nsec : time)
- -> `Ok sec*1000 + nsec/1_000_000
+ -> `Ok (sec*1000 + nsec/1_000_000)
else
-> check(r)
;;
diff --git a/lib/std/test/search.myr b/lib/std/test/search.myr
index eea3680..31e1e63 100644
--- a/lib/std/test/search.myr
+++ b/lib/std/test/search.myr
@@ -5,13 +5,13 @@ const sl = [1, 3, 5, 8, 9, 33]
const main = {
expect(std.lsearch(sl[:], 1, std.numcmp), `std.Some 0)
- expect(std.lsearch(sl[:], 33, std.numcmp), `std.Some sl.len - 1)
+ expect(std.lsearch(sl[:], 33, std.numcmp), `std.Some (sl.len - 1))
expect(std.lsearch(sl[:], 5, std.numcmp), `std.Some 2)
expect(std.lsearch(sl[:], 6, std.numcmp), `std.None)
expect(std.lsearch(sl[:0], 6, std.numcmp), `std.None)
expect(std.bsearch(sl[:], 1, std.numcmp), `std.Some 0)
- expect(std.bsearch(sl[:], 33, std.numcmp), `std.Some sl.len - 1)
+ expect(std.bsearch(sl[:], 33, std.numcmp), `std.Some (sl.len - 1))
expect(std.bsearch(sl[:], 5, std.numcmp), `std.Some 2)
expect(std.bsearch(sl[:], 6, std.numcmp), `std.None)
expect(std.bsearch(sl[:0], 1, std.numcmp), `std.None) /* empty slice */