summaryrefslogtreecommitdiff
path: root/lib/date
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-08-31 12:59:13 -0400
committerOri Bernstein <ori@eigenstate.org>2014-08-31 12:59:13 -0400
commit3badf9c6ec1f77fffcc6714888a44d715346b3d0 (patch)
tree14e97a3d812944c08993529e24add150c2e32118 /lib/date
parentcb7369fdcdfba4090241c5415d97e627a10189d3 (diff)
downloadmc-3badf9c6ec1f77fffcc6714888a44d715346b3d0.tar.gz
Rename diff to delta.
Diffstat (limited to 'lib/date')
-rw-r--r--lib/date/date.myr20
-rw-r--r--lib/date/types.myr6
-rw-r--r--lib/date/zoneinfo.myr4
3 files changed, 15 insertions, 15 deletions
diff --git a/lib/date/date.myr b/lib/date/date.myr
index 6d9749a..dee902a 100644
--- a/lib/date/date.myr
+++ b/lib/date/date.myr
@@ -9,16 +9,16 @@ pkg date =
const tozone : (d : instant, zone : byte[:] -> instant)
const mkdate : (tm : std.time, zone : byte[:] -> instant)
- const localoff : (tm : std.time -> diff)
- const tzoff : (tzname : byte[:], tm : std.time -> diff)
+ const localoff : (tm : std.time -> delta)
+ const tzoff : (tzname : byte[:], tm : std.time -> delta)
const isleap : (d : instant -> bool)
- /* date differences */
- const add : (d : instant, dt : diff -> instant)
- const sub : (d : instant, dt : diff -> instant)
- const diff : (a : instant, b : instant -> diff)
- const duradd : (d : instant, dt : duration -> instant)
- const dursub : (d : instant, dt : duration -> instant)
+ /* date deltaerences */
+ const add : (d : instant, dt : delta -> instant)
+ const sub : (d : instant, dt : delta -> instant)
+ const delta : (a : instant, b : instant -> delta)
+ const duradd : (d : instant, dt : period -> instant)
+ const dursub : (d : instant, dt : period -> instant)
;;
const UnixJulianDiff = 719468
@@ -126,7 +126,7 @@ const sub = {d, dt
-const diff = {a, b
- -> (b.actual - a.actual) castto(diff)
+const delta = {a, b
+ -> (b.actual - a.actual) castto(delta)
}
diff --git a/lib/date/types.myr b/lib/date/types.myr
index 76bba30..6fbb0d0 100644
--- a/lib/date/types.myr
+++ b/lib/date/types.myr
@@ -3,7 +3,7 @@ use std
pkg date =
type instant = struct
actual : std.time /* epoch time in microseconds */
- tzoff : diff /* timezone offset in microseconds */
+ tzoff : delta /* timezone offset in microseconds */
year : int /* year, starting at 0 (ie, 1 BCE) */
mon : int /* month, [1..12] */
day : int /* day, [1..31] */
@@ -16,9 +16,9 @@ pkg date =
_tzbuf : byte[32] /* current time zone name storage */
;;
- type diff = std.time
+ type delta = std.time
- type duration = union
+ type period = union
`Day int
`Month int
`Year int
diff --git a/lib/date/zoneinfo.myr b/lib/date/zoneinfo.myr
index e7d274c..e4bdd72 100644
--- a/lib/date/zoneinfo.myr
+++ b/lib/date/zoneinfo.myr
@@ -3,7 +3,7 @@ use "types.use"
pkg _zoneinfo =
type zifile
- const findtzoff : (tz : byte[:], tm : std.time -> date.diff)
+ const findtzoff : (tz : byte[:], tm : std.time -> date.delta)
const load : (file : byte[:] -> zifile#)
const free : (f : zifile# -> void)
;;
@@ -68,7 +68,7 @@ const findtzoff = {tz, tm
;;
ds = zone.ttinfo[zone.timetype[i]].gmtoff
free(zone)
- -> (ds castto(date.diff)) * 1_000_000
+ -> (ds castto(date.delta)) * 1_000_000
}
const load = {file