CrossClj

0.1.0 docs

SourceDocs



RECENT
    VARS
    compound-compare
    compound-compare-fn
    ensure-sequential
    filter-by-index
    filter-by-index-pred
    find-first
    in?
    into-by
    join-seq
    map-
    map-indexed-
    mapcat-
    not-in?
    remove-by-index
    remove-by-index-pred
    starts-with
    take-while-reduce

    « Index of all namespaces of this project

    general sequence utils
    
    (compound-compare [f & fns] v1 v2)
    compare 
     (cmp1 v1 v2)
     (cmp2 v1 v2)
     ...
    
    returns value if any returns none-zero or ultimately 0 (same) 
    
    (compound-compare-fn & fns)
    (ensure-sequential v)
    ensure that you have a sequence
    
    (filter-by-index idx-set a-seq)
    filter (include) indexes in the set idx-set
    
    (filter-by-index-pred pred? a-seq)
    filter (include) indexes for which (pred? i) is true
    
    (find-first pred? a-seq)
    find first element, e, for which (pred? e) is true
    
    (in? a-seq v)
    v in seq
    
    (into-by m f a-seq)
    convert ( e1 e2 e3 ...) to
    { (f e1) e1 
      (f e2) e2 
      (f e3) e3 ... }
    (join-seq sep a-seq)
    join a seq with a separator sep
    
    (map- remove? f & colls)
    (map-indexed- remove? f coll)
    map indexed removing items if (remove? (f i v)) is true
    
    (mapcat- remove? f & colls)
    (not-in? v a-seq)
    v not in seq
    
    (remove-by-index idx-set a-seq)
    (remove-by-index-pred pred? a-seq)
    remove indexes for which (pred? i) is true
    
    (starts-with a-seq sub-seq)
    (take-while-reduce initial reduce-fn pred coll)
    fancy take accumulating a reduced value on taken items
     this value can then be tested in the take fn
    
    e.g (take-while-reduce 0 (fn [v i] (inc v)) 
                             (fn [v i] (= v i)) 
                           [1 2 3 5 6 7])
    => (1 2 3)