namenu / data.deque Goto Github PK
View Code? Open in Web Editor NEWPersistent Deque for Clojure(Script)
License: Other
Persistent Deque for Clojure(Script)
License: Other
(require '[data.deque :as dq])
(conj [] (dq/deque 1))
;;=> [<top-(1)-bottom>]
(conj #{} (dq/deque 1))
;;=> Unhandled java.lang.ClassCastException
;; data.deque.PersistentDeque cannot be cast to java.lang.Iterable
core.clj: 5186 clojure.core/hash-ordered-coll
core.clj: -1 clojure.core/hash-ordered-coll
deque.clj: 77 data.deque.PersistentDeque/hasheq
Util.java: 177 clojure.lang.Util/dohasheq
Util.java: 168 clojure.lang.Util/hasheq
PersistentHashMap.java: 120 clojure.lang.PersistentHashMap/hash
PersistentHashMap.java: 143 clojure.lang.PersistentHashMap/assoc
PersistentHashSet.java: 99 clojure.lang.PersistentHashSet/cons
PersistentHashSet.java: 17 clojure.lang.PersistentHashSet/cons
RT.java: 673 clojure.lang.RT/conj
core.clj: 85 clojure.core/conj
core.clj: 82 clojure.core/conj
I encountered the issue also for type data.deque.PersistentDequeSeq
, as I tried to extract the item using seq
as a work-around.
I ended up using map
to obtain a non-data.deque type so was wondering if this is intentional? Thanks!
(conj #{} (map identity (dq/deque 1)))
;;=> #{(1)}
There is a problem with the following:
(require '[data.deque :as dq])
(assert (= (list 2 nil)
(-> (dq/deque)
(dq/add-first nil)
(dq/add-first nil)
(dq/add-first 2)
dq/remove-last
seq)))
Interesting is the fact that if we add-last
and then remove-first
it works correctly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.