I'm a little surprised to see that some functions silently return nil(or the default value that you pass) when you pass something that is not the card on which the card is expected.
Take first the following document and an example that works as I expected:
user> (doc dissoc)
-------------------------
clojure.core/dissoc
([map] [map key] [map key & ks])
dissoc[iate]. Returns a new map of the same (hashed/sorted) type,
that does not contain a mapping for key(s).
The first argument dissocshould be a map according to the document, so here is what happens:
user> (dissoc {:a 1 :b 2} :b)
{:a 1}
It works fine, I passed the card. Pass something that is not a map for this function, whose document says that the first argument should be a map:
user> (dissoc 1 :b)
ClassCastException java.lang.Long cannot be cast to clojure.lang.IPersistentMap clojure.lang.RT.dissoc (RT.java:758)
Fairly enough, an exception is thrown at runtime, and the problem is clear enough, this is the behavior I was expecting.
:
user> (doc get)
-------------------------
clojure.core/get
([map key] [map key not-found])
Returns the value mapped to key, not-found or nil if key not present.
get , :
user> (get {:a 1} :a)
1
. -, , , :
user> (get 42 :a)
nil
. , . "".
, -, , , , ?
"", , Clojure , nil, , ?
: Clojure Clojure "", , , get , nil, , ?