diff options
Diffstat (limited to 'stdlib/source/library/lux/time')
-rw-r--r-- | stdlib/source/library/lux/time/date.lux | 50 | ||||
-rw-r--r-- | stdlib/source/library/lux/time/instant.lux | 4 | ||||
-rw-r--r-- | stdlib/source/library/lux/time/month.lux | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/time/year.lux | 8 |
4 files changed, 32 insertions, 32 deletions
diff --git a/stdlib/source/library/lux/time/date.lux b/stdlib/source/library/lux/time/date.lux index 75e5609ea..d06910711 100644 --- a/stdlib/source/library/lux/time/date.lux +++ b/stdlib/source/library/lux/time/date.lux @@ -95,7 +95,7 @@ (template [<name> <type> <field>] [(def: .public <name> (-> Date <type>) - (|>> :representation (get@ <field>)))] + (|>> :representation (value@ <field>)))] [year Year #year] [month Month #month] @@ -109,13 +109,13 @@ (let [reference (:representation reference) sample (:representation sample)] (and (\ //year.equivalence = - (get@ #year reference) - (get@ #year sample)) + (value@ #year reference) + (value@ #year sample)) (\ //month.equivalence = - (get@ #month reference) - (get@ #month sample)) - (n.= (get@ #day reference) - (get@ #day sample)))))) + (value@ #month reference) + (value@ #month sample)) + (n.= (value@ #day reference) + (value@ #day sample)))))) (implementation: .public order (Order Date) @@ -126,19 +126,19 @@ (let [reference (:representation reference) sample (:representation sample)] (or (\ //year.order < - (get@ #year reference) - (get@ #year sample)) + (value@ #year reference) + (value@ #year sample)) (and (\ //year.equivalence = - (get@ #year reference) - (get@ #year sample)) + (value@ #year reference) + (value@ #year sample)) (or (\ //month.order < - (get@ #month reference) - (get@ #month sample)) + (value@ #month reference) + (value@ #month sample)) (and (\ //month.order = - (get@ #month reference) - (get@ #month sample)) - (n.< (get@ #day reference) - (get@ #day sample))))))))) + (value@ #month reference) + (value@ #month sample)) + (n.< (value@ #day reference) + (value@ #day sample))))))))) ) (def: section_parser @@ -271,17 +271,17 @@ ..civil_month))) (def: last_era_leap_day - (.int (dec ..days_per_leap))) + (.int (-- ..days_per_leap))) (def: last_era_day - (.int (dec ..days_per_era))) + (.int (-- ..days_per_era))) (def: (civil_year utc_month utc_year) (-> Nat Year Int) (let [... Coercing, because the year is already in external form. utc_year (:as Int utc_year)] (if (n.< ..first_month_of_civil_year utc_month) - (dec utc_year) + (-- utc_year) utc_year))) ... http://howardhinnant.github.io/date_algorithms.html @@ -290,7 +290,7 @@ (let [utc_month (|> date ..month //month.number) civil_year (..civil_year utc_month (..year date)) era (|> (if (i.< +0 civil_year) - (i.- (.int (dec //year.era)) + (i.- (.int (-- //year.era)) civil_year) civil_year) (i./ (.int //year.era))) @@ -299,7 +299,7 @@ civil_year) day_of_year (|> utc_month ..day_of_year_from_month - (i.+ (.int (dec (..day_of_month date))))) + (i.+ (.int (-- (..day_of_month date))))) day_of_era (|> day_of_year (i.+ (i.* (.int //year.days) year_of_era)) (i.+ (i./ (.int //year.leap) year_of_era)) @@ -334,7 +334,7 @@ (i.+ +1) .nat) year (if (n.< ..first_month_of_civil_year month) - (inc year) + (++ year) year)] ... Coercing, because the year is already in internal form. (try.trusted @@ -348,7 +348,7 @@ (def: &order ..order) (def: succ - (|>> ..days inc ..of_days)) + (|>> ..days ++ ..of_days)) (def: pred - (|>> ..days dec ..of_days))) + (|>> ..days -- ..of_days))) diff --git a/stdlib/source/library/lux/time/instant.lux b/stdlib/source/library/lux/time/instant.lux index 36e0b2504..f454c1425 100644 --- a/stdlib/source/library/lux/time/instant.lux +++ b/stdlib/source/library/lux/time/instant.lux @@ -102,7 +102,7 @@ (let [[days millis] (i./% ..millis_per_day offset)] (case millis +0 [days millis] - _ [(dec days) (i.+ ..millis_per_day millis)])) + _ [(-- days) (i.+ ..millis_per_day millis)])) (i./% ..millis_per_day offset))] [(date.of_days days) (duration.of_millis day_time)])) @@ -214,7 +214,7 @@ day_time (duration.framed duration.day offset) days (if (and (duration.negative? offset) (not (duration.neutral? day_time))) - (dec days) + (-- days) days) ... 1970/01/01 was a Thursday y1970m0d0 +4] diff --git a/stdlib/source/library/lux/time/month.lux b/stdlib/source/library/lux/time/month.lux index d8203e175..07fcc6269 100644 --- a/stdlib/source/library/lux/time/month.lux +++ b/stdlib/source/library/lux/time/month.lux @@ -184,7 +184,7 @@ {#.doc (example "The amount of days of a month (in a leap year).")} (-> Month Nat) (case month - #February (inc (..days month)) + #February (++ (..days month)) _ (..days month))) (def: .public year diff --git a/stdlib/source/library/lux/time/year.lux b/stdlib/source/library/lux/time/year.lux index dd303ed85..3eb12ad90 100644 --- a/stdlib/source/library/lux/time/year.lux +++ b/stdlib/source/library/lux/time/year.lux @@ -23,14 +23,14 @@ (def: (internal year) (-> Int Int) (if (i.< +0 year) - (inc year) + (++ year) year)) (def: (external year) (-> Int Int) (if (i.> +0 year) year - (dec year))) + (-- year))) (exception: .public there_is_no_year_0) @@ -100,8 +100,8 @@ (-> Year Int) (let [year (|> year ..value ..internal) limit (if (i.> +0 year) - (dec year) - (inc year))] + (-- year) + (++ year))] (`` (|> +0 (~~ (template [<polarity> <years>] [(<polarity> (i./ (.int <years>) limit))] |