Activity

The implementation of clojure.core/get returns null if its argument is not a valid associative collection. However, calling 'get' on something which is neither nil nor an Associative collection is almost certainly a programmer error, and should be indicated by an exception.

CLJ-932 was accepted as a similar enhancement to 'clojure.core/contains?'

The implementation of clojure.core/get returns null if its argument is not a valid associative collection. However, calling 'get' on something which is neither nil nor an Associative collection is almost certainly a bug, and should be indicated by an exception.

This behavior can obscure common programmer errors such as:

{code}
(def a (atom {:a 1 :b 2})

(:foo a) ; forgot to deref a
;;=> nil
{code}

CLJ-932 was accepted as a similar enhancement to 'clojure.core/contains?'

Attached patch 0001 throws an IllegalArgumentException as the fall-through case of RT.getFrom.

The implementation of clojure.core/get returns null if its argument is not a valid associative collection. However, calling 'get' on something which is neither nil nor an Associative collection is almost certainly a bug, and should be indicated by an exception.

This behavior can obscure common programmer errors such as:

{code}
(def a (atom {:a 1 :b 2})

(:foo a) ; forgot to deref a
;;=> nil
{code}

CLJ-932 was accepted as a similar enhancement to 'clojure.core/contains?'

Attached patch 0001 throws an IllegalArgumentException as the fall-through case of RT.getFrom.

The implementation of {{clojure.core/get}} returns {{nil}} if its argument is not an associative collection.

This behavior can obscure common programmer errors such as:

{code}
(def a (atom {:a 1 :b 2})

(:foo a) ; forgot to deref a
;;=> nil
{code}

Calling {{get}} on something which is neither {{nil}} nor an Associative collection is almost certainly a bug, and should be indicated by an exception.

CLJ-932 was accepted as a similar enhancement to {{clojure.core/contains?}}