Clojure

(partition 0 seq) and (parition-all 0 seq) are infinite sequences of empty sequences

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: Release 1.1, Release 1.2
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

(partition n seq) and (partition-all n seq) are implemented by taking n and dropping n from seq. When n=0 this becomes an infinite sequence of empty sequences.

While conceptionally this makes sense, I think practically it may surprise people, and perhaps it should return an empty sequence or a sequence of a single empty sequence.

Activity

Andy Fingerhut made changes -
Field Original Value New Value
Priority Major [ 3 ] Minor [ 4 ]

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated: