[CLJ-1107] 'get' should throw exception on non-Associative argument Created: 13/Nov/12 Updated: 23/Nov/13
|Reporter:||Stuart Sierra||Assignee:||Stuart Sierra|
|Patch:||Code and Test|
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:
Attached patch 0001 throws an IllegalArgumentException as the fall-through case of RT.getFrom.
|Comment by Andy Fingerhut [ 24/May/13 12:31 PM ]|
Patch clj-1107-throw-on-get-for-unsupported-types-patch-v2.txt dated May 24 2013 is identical to 0001-CLJ-1107-Throw-exception-for-get-called-on-unsupport.patch dated Nov 13 2012, except it applies cleanly to latest master. A recent commit for