Fork me on GitHub
Ivan Koz00:05:59

from docs to < and <=

; <= Returns non-nil if nums are in monotonically increasing order, otherwise false.
;  < Returns non-nil if nums are in monotonically non-decreasing order, otherwise false.
Is there any difference between increasing and non-decreasing? Looks like synonyms to me.


increasing has to increase and non-decreasing does not in the case of it being the same number (so [1 1 1 1 2 3 4] is non decreasing but it isn’t always increasing)

Ivan Koz02:05:39

@hobosarefriends oh now i understand the meaning


no probs!


And note you had the doc strings backwards


when mapping over a hash-map what does the mapping function get as an argument?

Ivan Koz15:05:46

@nicholas.jaunsen a vector pair of key and value

Ivan Koz15:05:45

you can imagine a map as a sequence of map entries (key-value pairs)


why destructuring has :as if you can already access the full arg?

(let [range-vec (vec (range 10))
      [a b c & more :as all] range-vec]
        (println (= all range-vec)))
and they are equal.


@twaima I think because it lets you consolidate lines like this:

(let [[a b c & more :as range-vec] (vec (range 10))]
        (println (= all range-vec)))

👍 1
✔️ 1