Public Vars

Back

drop-last (clj)

(source)

function

(drop-last coll) (drop-last n coll)
Return a lazy sequence of all but the last n (default 1) items in coll

Examples

originrose/cortex
(ns cortex.tree-test
  (:require
    #?(:cljs [cljs.test :refer-macros [deftest is are testing]]
        :clj [clojure.test :refer [deftest is are testing]])
    [clojure.core.matrix :as mat]
    [clojure.core.matrix.random :as randm]
    #?(:cljs [thi.ng.ndarray.core :as nd])
    [clojure.zip :as zip]
    [cortex.tree :as tree]))

(def IRISES (read-string (slurp "test/data/iris.edn")))
(def X (mat/matrix (map drop-last IRISES)))
(def Y (mat/matrix (map last IRISES)))
typedclojure/typedclojure
(ns ^:no-doc typed.ann.clojure
  "Type annotations for the base Clojure distribution."
  #?(:cljs (:require-macros [typed.ann-macros.clojure :as macros]))
  (:require [clojure.core :as cc]
            [typed.clojure :as t]
            #?(:clj [typed.ann-macros.clojure :as macros])
            #?(:clj typed.ann.clojure.jvm) ;; jvm annotations
            #?(:clj clojure.core.typed))
  #?(:clj
     (:import (clojure.lang PersistentHashSet PersistentList
                            APersistentMap #_IPersistentCollection
                            #_ITransientSet
                            IRef)
              (java.util Comparator Collection))))

cc/take (t/All [x] (t/IFn [t/Int :-> (t/Transducer x x)]
                          [t/Int (t/Seqable x) :-> (t/ASeq x)]))
cc/drop (t/All [x] (t/IFn [t/Int :-> (t/Transducer x x)]
                          [t/Int (t/Seqable x) :-> (t/ASeq x)]))
cc/take-last (t/All [x] [t/Int (t/Seqable x) :-> (t/NilableNonEmptyASeq x)])
cc/drop-last (t/All [x] [(t/? t/Int) (t/Seqable x) :-> (t/ASeq x)])