<< Back to previous view

[CLJ-1098] Extend CollFold and IKVReduce to nil Created: 31/Oct/12  Updated: 01/Mar/13  Resolved: 25/Jan/13

Status: Closed
Project: Clojure
Component/s: None
Affects Version/s: None
Fix Version/s: Release 1.5

Type: Enhancement Priority: Minor
Reporter: Herwig Hochleitner Assignee: Unassigned
Resolution: Completed Votes: 3
Labels: None

Attachments: Text File 0001-CLJ-1098-Implement-IKVReduce-and-CollFold-for-nil.patch    
Patch: Code and Test
Approval: Ok


Currently, reduce-kv and fold throw when used on nil, because their respective protocols don't extend to nil. This seems strange, since Clojure tends to handle nils gracefully where possible, especially in places where collections are expected.

See thread https://groups.google.com/d/topic/clojure/tGI8sIKQoh0/discussion

Comment by Herwig Hochleitner [ 31/Oct/12 8:44 PM ]

Attached patch with tests

Comment by Andy Fingerhut [ 14/Jan/13 11:04 AM ]

Another discussion thread: https://groups.google.com/forum/?fromgroups=#!topic/clojure/xPDDybYGvmc

Generated at Sun Apr 23 15:08:57 CDT 2017 using JIRA 4.4#649-r158309.