Fork me on GitHub
#beginners
<
2019-05-05
>
k.i.o00: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.

hobosarefriends01:05:02

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)

k.i.o02:05:39

@hobosarefriends oh now i understand the meaning

k.i.o02:05:52

thank you!

dpsutton04:05:47

And note you had the doc strings backwards

nicholas.jaunsen15:05:54

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

k.i.o15:05:46

@nicholas.jaunsen a vector pair of key and value

k.i.o15:05:45

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

twaima20:05:38

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.

upgradingdave20:05:50

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