mirror of
https://github.com/penpot/penpot.git
synced 2025-08-03 23:48:28 +02:00
🎉 Introduce ordered-set type and use it for workspace selected.
This commit is contained in:
parent
778bfbab59
commit
1dd1b9d987
9 changed files with 78 additions and 23 deletions
|
@ -8,10 +8,27 @@
|
|||
"Data manipulation and query helper functions."
|
||||
(:refer-clojure :exclude [concat read-string])
|
||||
(:require [clojure.set :as set]
|
||||
[linked.set :as lks]
|
||||
#?(:cljs [cljs.reader :as r]
|
||||
:clj [clojure.edn :as r])
|
||||
#?(:cljs [cljs.core :as core]
|
||||
:clj [clojure.core :as core])))
|
||||
:clj [clojure.core :as core]))
|
||||
#?(:clj
|
||||
(:import linked.set.LinkedSet)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Data Structures
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn ordered-set
|
||||
([] lks/empty-linked-set)
|
||||
([a] (conj lks/empty-linked-set a))
|
||||
([a & xs] (apply conj lks/empty-linked-set a xs)))
|
||||
|
||||
(defn ordered-set?
|
||||
[o]
|
||||
#?(:cljs (instance? lks/LinkedSet o)
|
||||
:clj (instance? LinkedSet o)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Data Structures Manipulation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue