Public Vars

Back

rseq (clj)

(source)

function

(rseq rev)
Returns, in constant time, a seq of the items in rev (which can be a vector or sorted-map), in reverse order. If rev is empty returns nil

Examples

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))))

#?(:cljs (do
(t/ann-protocol cljs.core/Fn)
(t/ann-protocol cljs.core/IFn)
(t/ann-protocol cljs.core/ICloneable
                -clone [cljs.core/ICloneable :-> t/Any])
(t/ann-protocol [[x :variance :covariant]]
                cljs.core/IIterable
                ;; TODO
                -iterator [(cljs.core/IIterable x) :-> t/Any #_Object])
(t/ann-protocol cljs.core/ICounted
                -count [cljs.core/ICounted :-> t/Num])
(t/ann-protocol cljs.core/IEmptyableCollection
                ;; :/ TFn param on protocol?
                -empty [cljs.core/IEmptyableCollection :-> t/Any])
(t/ann-protocol cljs.core/ICollection
                -conj [cljs.core/ICollection t/Any :-> cljs.core/ICollection])
(t/ann-protocol [[x :variance :covariant]] cljs.core/IIndexed
                -nth (t/All [y]
                            [(cljs.core/IIndexed x) t/JSnumber (t/? y) :-> (t/U x y)]))
(t/ann-protocol cljs.core/ASeq)
(t/ann-protocol [[x :variance :covariant
                  ;;FIXME causes mystery error
                  ;:< t/AnyNilableNonEmptySeq
                  ]]
                cljs.core/ISeqable)
(t/ann-protocol [[x :variance :covariant]] cljs.core/ISeq
                -first [(cljs.core/ISeq x) :-> (t/Nilable x)]
                -rest [(cljs.core/ISeq x) :-> (cljs.core/ISeq x)])
;cljs.core/INext [[x :variance :covariant]]
(t/ann-protocol [[v :variance :covariant]] cljs.core/ILookup)
(t/ann-protocol [[k :variance :covariant]
                 [v :variance :covariant]]
                cljs.core/IAssociative
                -contains-key [(cljs.core/IAssociative k v) t/Any :-> t/Bool]
                -assoc (t/All [k1 v1] [(cljs.core/IAssociative k v) k1 v1 :->
                                       (cljs.core/IAssociative (t/U k k1) (t/U v v1))]))
(t/ann-protocol cljs.core/IMap
                -dissoc [cljs.core/IMap t/Any :-> cljs.core/IMap])
(t/ann-protocol [[k :variance :covariant]
                 [v :variance :covariant]]
                cljs.core/IMapEntry
                -key [(cljs.core/IMapEntry k v) :-> k]
                -val [(cljs.core/IMapEntry k v) :-> v])
(t/ann-protocol cljs.core/ISet
                -disjoin (t/All [s] [s t/Any :-> s]))
(t/ann-protocol [[x :variance :covariant]]
                cljs.core/IStack
                -peek [(cljs.core/IStack x) :-> (t/U nil x)]
                -pop [(cljs.core/IStack x) :-> (cljs.core/IStack x)])
(t/ann-protocol [[x :variance :covariant]]
                cljs.core/IVector
                -assoc-n (t/All [x1] [(cljs.core/IVector x) t/Num x1
                                      :-> (cljs.core/IVector (t/U x x1))]))
(t/ann-protocol [[x :variance :covariant]]
                cljs.core/IDeref
                -deref [(cljs.core/IDeref x) :-> x])
(t/ann-protocol [[x :variance :covariant]]
                cljs.core/IDerefWithTimeout
                -deref-with-timeout [(cljs.core/IDerefWithTimeout x) :-> x])
(t/ann-protocol cljs.core/IMeta
                -meta [cljs.core/IMeta :-> (t/Nilable (t/Map t/Any t/Any))])
(t/ann-protocol cljs.core/IWithMeta
                -with-meta [cljs.core/IWithMeta (t/Nilable (t/Map t/Any t/Any)) :-> cljs.core/IWithMeta])
;TODO
;cljs.core/IReduce [[]]
(t/ann-protocol cljs.core/IKVReduce ;;TODO
                -kv-reduce [cljs.core/IKVReduce [t/Any t/Any t/Any :-> t/Any] :-> t/Any])
(t/ann-protocol cljs.core/IList)
(t/ann-protocol cljs.core/IEquiv
                -equiv [cljs.core/IEquiv t/Any :-> t/Bool])
(t/ann-protocol cljs.core/IHash
                -hash [cljs.core/IHash :-> t/Num])
(t/ann-protocol cljs.core/ISequential)
(t/ann-protocol cljs.core/IRecord)
(t/ann-protocol [[x :variance :covariant]]
                cljs.core/IReversible
                -rseq [(cljs.core/IReversible x) :-> (t/NilableNonEmptySeq x)])
(t/ann-protocol [[k :variance :covariant]
                 [v :variance :covariant]] cljs.core/IFind
                -find [(cljs.core/IFind k v) t/Any :-> (t/Nilable (cljs.core/IMapEntry k v))]
                )
(t/ann-protocol [[x :variance :invariant]]
                cljs.core/ISorted
                -sorted-seq [(cljs.core/ISorted x) t/Bool :-> (t/Nilable (t/ASeq x))]
                ;; second arg => comparable?
                -sorted-seq-from [(cljs.core/ISorted x) t/Any t/Bool :-> (t/Nilable (t/ASeq x))]
                -entry-key [(cljs.core/ISorted x) t/Any :-> t/Any]
                -comparator [(cljs.core/ISorted x) :-> [x x :-> t/Num]])
(t/ann-protocol cljs.core/IPending)
;cljs.core/IWriter [[]]
;cljs.core/IPrintWithWriter [[]]
;    ;TODO
;;cljs.core/IWatchable [[]]
;    ;cljs.core/IEditableCollection [[]]
;    ;cljs.core/ITransientCollection [[]]
;    ;cljs.core/ITransientAssociative [[]]
;    ;cljs.core/ITransientMap [[]]
;    ;cljs.core/ITransientVector [[]]
;    ;cljs.core/ITransientSet [[]]
(t/ann-protocol [[x :variance :invariant]]
                cljs.core/IComparable)
;    ;cljs.core/IChunk [[]]
;    ;cljs.core/IChunkedSeq [[]]
;    ;cljs.core/IChunkedNext [[]]
(t/ann-protocol cljs.core/INamed
                -named [cljs.core/INamed :-> t/Str]
                -namespace [cljs.core/INamed :-> (t/Nilable t/Str)])
(t/ann-protocol [[x :variance :invariant]]
                cljs.core/IVolatile
                -vreset! (t/All [x] [(cljs.core/IVolatile x) x :-> x]))

cc/instance? [#?(:clj Class :cljs js/Object) t/Any :-> t/Bool]
cc/cons (t/All [x] [x (t/Seqable x) :-> (t/ASeq x)])
cc/reverse (t/All [x] [(t/Seqable x) :-> (t/ASeq x)])
cc/rseq (t/All [x] [(t/Reversible x) :-> (t/NilableNonEmptyASeq x)])
cc/subseq  (t/All [x e] [(t/I (t/Seqable e) (t/Sorted x)) [t/Int t/Int :-> t/Bool] t/Int (t/cat [t/Int t/Int :-> t/Bool] t/Int) :? :-> (t/Nilable (t/ASeq e))])
cc/rsubseq (t/All [x e] [(t/I (t/Seqable e) (t/Sorted x)) [t/Int t/Int :-> t/Bool] t/Int (t/cat [t/Int t/Int :-> t/Bool] t/Int) :? :-> (t/Nilable (t/ASeq e))])
dco-dev/interval-tree
(ns com.dean.interval-tree.tree.interval-set
  (:require [clojure.core.reducers       :as r :refer [coll-fold]]
            [clojure.set]
            [com.dean.interval-tree.tree.interval :as interval]
            [com.dean.interval-tree.tree.node     :as node]
            [com.dean.interval-tree.tree.order    :as order]
            [com.dean.interval-tree.tree.protocol :as proto]
            [com.dean.interval-tree.tree.root]
            [com.dean.interval-tree.tree.tree     :as tree])
  (:import  [clojure.lang                RT]
            [com.dean.interval_tree.tree.protocol PExtensibleSet]
            [com.dean.interval_tree.tree.root     INodeCollection
                                         IBalancedCollection
                                         IOrderedCollection
                                         IIntervalCollection]))

  clojure.lang.Reversible
  (rseq [this]
    (with-interval-set this
      (map node/-k (tree/node-seq-reverse root))))
dco-dev/interval-tree
(ns com.dean.interval-tree.tree.ordered-set
  (:require [clojure.core.reducers       :as r :refer [coll-fold]]
            [clojure.set]
            [com.dean.interval-tree.tree.node     :as node]
            [com.dean.interval-tree.tree.order    :as order]
            [com.dean.interval-tree.tree.protocol :as proto]
            [com.dean.interval-tree.tree.root]
            [com.dean.interval-tree.tree.tree     :as tree])
  (:import  [clojure.lang                RT]
            [com.dean.interval_tree.tree.protocol PExtensibleSet]
            [com.dean.interval_tree.tree.root     INodeCollection
                                         IBalancedCollection
                                         IOrderedCollection]))

  clojure.lang.Reversible
  (rseq [this]
    (with-ordered-set this
      (map node/-k (tree/node-seq-reverse root))))
dco-dev/interval-tree
(ns com.dean.interval-tree.tree.interval-map
  (:require [clojure.core.reducers       :as r :refer [coll-fold]]
            [com.dean.interval-tree.tree.interval :as interval]
            [com.dean.interval-tree.tree.node     :as node]
            [com.dean.interval-tree.tree.root]
            [com.dean.interval-tree.tree.order    :as order]
            [com.dean.interval-tree.tree.tree     :as tree])
  (:import  [clojure.lang                RT]
            [com.dean.interval_tree.tree.root     INodeCollection
                                         IBalancedCollection
                                         IOrderedCollection
                                         IIntervalCollection]))

  clojure.lang.Reversible
  (rseq [this]
    (with-interval-map this
      (map node/-kv (tree/node-seq-reverse root))))
dco-dev/interval-tree
(ns com.dean.interval-tree.tree.ordered-map
  (:require [clojure.core.reducers       :as r :refer [coll-fold]]
            [com.dean.interval-tree.tree.node     :as node]
            [com.dean.interval-tree.tree.protocol :as proto]
            [com.dean.interval-tree.tree.root]
            [com.dean.interval-tree.tree.tree     :as tree]
            [com.dean.interval-tree.tree.order    :as order])
  (:import  [clojure.lang                RT]
            [com.dean.interval_tree.tree.root     INodeCollection
                                         IBalancedCollection
                                         IOrderedCollection]))

  clojure.lang.Reversible
  (rseq [this]
    (with-ordered-map this
      (map node/-kv (tree/node-seq-reverse root))))