Clojure

zipper: children does not check node type

Details

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

Description

children does not check the node type.

Reported by Justin Balthrop on #clojure.

To reproduce:

(-> (clojure.core/vector-zip '[(1 2) (3 4)]) clojure.zip/down clojure.zip/down) descends into the list, where it should not.

Proposed fix:

children should check branch? and throw an exception if the node is actually a leaf.

Patch attached.

Activity

Hide
Assembla Importer added a comment -

meikelbrandmeyer said: [file:cqC9AaydWr3PjFeJe5afGb]: Patch for the children bug in the zipper

Show
Assembla Importer added a comment - meikelbrandmeyer said: [file:cqC9AaydWr3PjFeJe5afGb]: Patch for the children bug in the zipper

People

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

Dates

  • Created:
    Updated:
    Resolved: