8000 t/concur fails · Issue #67 · juxt/tick · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
t/concur fails #67
Open
Open
@danieroux

Description

@danieroux
(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)))

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0