Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t/concur fails #67

Open
danieroux opened this issue Oct 31, 2019 · 0 comments
Open

t/concur fails #67

danieroux opened this issue Oct 31, 2019 · 0 comments
Assignees

Comments

@danieroux
Copy link

(t/concur
  #:tick{:beginning #time/instant"2000-01-01T01:00:01.011Z", :end #time/instant"2000-01-01T02:00:01.011Z"}
  #:tick{:beginning #time/instant"2000-01-01T00:00:00.003Z", :end #time/instant"2000-01-01T01:00:00.003Z"}
  #:tick{:beginning #time/instant"2000-01-01T01:00:01.179Z", :end #time/instant"2000-01-01T02:00:01.179Z"})

Fails with:

No implementation of method: :< of protocol: #'tick.core/ITimeComparison found for class: nil

Because: tick.interval/relation cannot handle nil, which it will get in the example above.

I worked around it by doing:

(defn safe-concur
  ([] nil)
  ([x] x)
  ([x & args]
   (reduce
     (fn safe-concur-check [x y]
       (and
         (and x y)
         (tick.interval/concur x y)))
     x args)))
@danieroux danieroux changed the title t/concur fails t/concur fails Oct 31, 2019
@danieroux danieroux changed the title t/concur fails t/concur fails Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants