Skip to content

Instantly share code, notes, and snippets.

@odyssomay
Created July 9, 2011 10:47
Show Gist options
  • Save odyssomay/1073506 to your computer and use it in GitHub Desktop.
Save odyssomay/1073506 to your computer and use it in GitHub Desktop.
java iterator
(defn extract-points [iterator]
(fn []
(let [points (make-array Double/TYPE 6)]
(.currentSegment iterator points)
(.next iterator))))
(defn extract-all-points [path_iterator]
(doall
(take-while (fn [_] (not (.isDone path_iterator)))
(repeatedly (extract-points path_iterator))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment