s-celles / AIRAC.jl

Julia library to deal with AIRAC cycle dates
MIT License
1 stars 0 forks source link

Implements Airac arithmetic #1

Open s-celles opened 3 years ago

s-celles commented 3 years ago

Instead of move, next, previous it could be possible to do

Airac() + 1
Airac() - 1

or

Airac() + AiracDiff()
Airac() - AiracDiff()

It could also be possible to do

julia> a1=Airac(2018)
Airac(1801, 2018-01-04)

julia> a2=Airac(2023) - AiracDiff()
Airac(2213, 2022-12-29)

julia> a1:a2
s-celles commented 3 years ago
julia> range(a1, stop=a2, step=AiracDiff())
ERROR: MethodError: no method matching -(::Airac, ::Int64)
Closest candidates are:
  -(::Base.CoreLogging.LogLevel, ::Integer) at logging.jl:117
  -(::Airac, ::AiracDiff) at C:\Users\Admin-pc\.julia\dev\AIRAC\src\AIRAC.jl:110
  -(::Airac, ::Airac) at C:\Users\Admin-pc\.julia\dev\AIRAC\src\AIRAC.jl:114
  ...
Stacktrace:
 [1] steprange_last(::Airac, ::AiracDiff, ::Airac) at .\range.jl:235
 [2] StepRange at .\range.jl:205 [inlined]
 [3] StepRange at .\range.jl:256 [inlined]
 [4] _colon at .\range.jl:46 [inlined]
 [5] Colon at .\range.jl:40 [inlined]
 [6] _range at .\range.jl:103 [inlined]
 [7] #range#43 at .\range.jl:91 [inlined]
 [8] top-level scope at REPL[91]:1