LoginSignup
1
0

More than 5 years have passed since last update.

2つの基準で大小判断

Posted at

date、idの順で大小を決定する Comparator。
もっとシンプルにできそうでできない。

(fn [a b]
  (let [a-date (:date a)
        b-date (:date b)]
    (if (= a-date b-date)
      (< (:id a) (:id b))
      (< a-date b-date))))
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0