Public Vars

Back

tree-seq (clj)

(source)

function

(tree-seq branch? children root)
Returns a lazy sequence of the nodes in a tree, via a depth-first walk. branch? must be a fn of one arg that returns true if passed a node that can have children (but may not). children must be a fn of one arg that returns a sequence of the children. Will only be called on nodes for which branch? returns true. Root is the root node of the tree.

Examples

tel/clatrix
(ns clatrix.matrix-api-test
  (:use clojure.test
        clojure.core.matrix.protocols)
  (:require [clatrix.core :as c]
            [clojure.core.matrix :as m]
            [clojure.core.matrix.protocols :as p]
            [clojure.core.matrix.compliance-tester :as comp]))

  (c/normalize (c/matrix [3 4]))
  (element-seq cv)
  (clojure.core/flatten M)
  (tree-seq sequential? seq M)