Clojure

GC Issue 53: tree-seq arbitrarily requires its root arg to be a branch

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Reported by christophe.grand, Jan 24, 2009
r1228:
user=> (tree-seq (constantly false) seq [1 2 3])
([1 2 3] 1 2 3) ; I expected ([1 2 3])

The actual behaviour of tree-seq is undefined when the root isn't a branch
since children is called upon root without any check.

The attached patch fixes this by always checking if a node is a branch
before calling children on it.

http://groups.google.com/group/clojure/browse_thread/thread/335707370295b654



 tree-seq.patch
1.6 KB Download
Comment 1 by richhickey, Jan 24, 2009
patch applied - svn 1231 - thanks!
Status: Fixed

People

  • Assignee:
    Unassigned
    Reporter:
    Anonymous
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: