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

 Description   

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



 Comments   
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 Fri Oct 24 10:24:52 CDT 2014 using JIRA 4.4#649-r158309.