ref: 3badf9c6ec1f77fffcc6714888a44d715346b3d0
parent: cb7369fdcdfba4090241c5415d97e627a10189d3
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Aug 31 08:59:13 EDT 2014
Rename diff to delta.
--- a/lib/date/date.myr
+++ b/lib/date/date.myr
@@ -9,16 +9,16 @@
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 diff = {a, b
- -> (b.actual - a.actual) castto(diff)
+const delta = {a, b
+ -> (b.actual - a.actual) castto(delta)
}
--- a/lib/date/types.myr
+++ b/lib/date/types.myr
@@ -3,7 +3,7 @@
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 @@
_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
--- a/lib/date/zoneinfo.myr
+++ b/lib/date/zoneinfo.myr
@@ -3,7 +3,7 @@
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 @@
;;
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