Lasertag: A library for categorizing types of values in Clojure, ClojureScript, and Babashka.
2026-06-29
Significant progress in performance. Results for common value types should now return in nanoseconds.
Primary and secondary tag categorization is now much closer to its final form.
Refer to the new masterlists in "Added" section below. There may be some additional
results in :all-tags entry (from tag-map) or some primary tags or secondary
might be called something different now e.g. :inst -> :datetime. This lib is
still alpha, so there could be some additional refinements going forward, but it
is less likely and these tags are becoming more hardened.
tag-map is now limited to the following entries:
[:tag :all-tags :classname :type]
If you want/need coll-size or fn-info, there a couple new experimental public apis (see below).[:agent
:array
:atom
:boolean
:char
:datetime
:delay
:function
:keyword
:list
:map
:nil
:number
:queue
:reader-conditional
:ref
:regex
:seq
:set
:string
:symbol
:throwable
:uuid
:var
:vector
:volatile]
[:array-like
:associative
:big-decimal
:big-int
:byte
:callable
:carries-meta
:char-sequence
:coll
:coll-like
:cons
:def
:deferred
:double
:editable
:error
:exception
:float
:fractional
:generator
:global-this
:hash-map
:infinite
:infinity
:-infinity
:inst
:int
:iterable
:js
:lazy
:list-like
:long
:map-entry
:map-like
:multi-function
:named
:nan
:nat-int
:neg
:neg-int
:object
:pos
:pos-int
:promise
:range
:ratio
:real
:record
:reference
:scalar
:seqable
:sequential
:set-like
:short
:sorted
:stack
:subvec
:transient
:typed-array
:whole
:zero]
lasertag.core.coll-size* - Experimental utility for getting coll-size across platforms.
lasertag.fns.fn-info - Experimental utility for getting function info.
Enhanced tests across clj / cljs / bb.
2026-03-14
Bumped Clojure to version 1.11.1
If using with bb, requires v1.12.210 or higher
Changed the following tags in the :all-tags entry in map returned from lasertag.core/tag-map:
:coll-type -> :coll-like
Removed the following redundant tags in the :all-tags entry in result of calling lasertag.core/tag-map:
:number-type
:java-lang-class
:java-util-class
Removed the following options as they were not compatible with the new enhanced perf, or obsolete:
:format
:include-all-tags
fireworks.cached namespace for enhanced perf - returns a "cached" result based on common value types
Added the support for the following missing primary tags:#30
:atom
:volatile
:future
:ref
:agent
:delay
:byte
:throwable
Added the support for the following missing secondary tags:
:reference
:lazy
:deferred
:scalar
2025-11-22
2025-07-11
2025-07-10
coll-size cannot be determined Addresses downstream issue #38 in Bling2025-07-08
java.util.AbstractCollection in Babashka context #232025-06-14
coll-size logic in lasertag.core/all-tags.:coll-size is now set to :lasertag.core/unknown-coll-size:2025-04-25
:java.lang.Class -> :class2025-04-01
Changed the following tags (result of calling lasertag.core/tag):
:js-object -> :object
:js-promise -> :promise
:js-iterable -> :iterable
:java.lang.Class -> :class
Added :iterable to :all-tags entry of lasertag.core/tag-map return value, for all java
values that are instances of java.lang.Iterable
2025-03-12
alengthcoll-size2024-11-24
Changed the following tags (result of calling lasertag.core/tag):
:js/Set -> :set
:js/Map -> :map
:js/WeakSet -> :set
:js/WeakMap -> :map
:js/Array -> :array
:js/ArrayBuffer -> :byte-array
Changed all tags that were namespaced with js/ to use a unified kebab-case
convention, e.g.:
js/Object -> :js-object
js/Int8Array -> :js-int8-array
All typed arrays in JS now get tagged with :array, with a more granular tag
e.g. :js-int8-array in the :all-tags entry of return value from lasertag.core/tag-map
2024-11-18
:include-all-tags?
:include-function-info?
:include-js-built-in-object-info?
(tag-map js/JSON
{:exclude [:all-tags?
:function-info?
:built-in-object-info?]})
2024-11-18
:inst tags #15:number tags #14:NaN -> :nan:Infinity -> :infinity:-Infinity -> :-infinity:demo entries in lasertag.cljs-interop to stringsnil value TypeError in cljs #132024-11-15
2024-11-8
:js-object and js-array to :all-tags map2024-11-7
lasertag.core/tag-map2024-11-6
Entries with a boolean value in the return value of lasertag.core/tag-map:
:carries-meta?:coll-type?:map-like?:set-like?:transient?:number-type?:java-lang-class?:java-util-class?:js-object?:js-array?The following tags are conditionally added to the :all-tags entry (hashset) in
the return value of lasertag.core/tag-map:
:carries-meta:coll-type:map-like:set-like:transient:number-type:java-lang-class:java-util-class:js-object:js-array
<br>
## 0.7.0
2024-11-3
### Added
- The following new entries in the return value of `lasertag.core/tag-map`:<br>
- `:set-like?`
- `:java-util-class?`
- `:java-lang-class?`
- `:classname`
### Breaking changes
- Some instances of java classes are now given tags like `:set`, `:map`, `:seq`,
or `:array`.
Examples:
```Clojure
(tag (java.util.HashMap. {"a" 1 "b" 2})) ; => :map
(tag (java.util.HashSet. {"a" "b" "c"})) ; => :set
(tag (java.util.ArrayList. [1 2 3])) ; => :array
2024-10-16
If tag of coll is :seq, and coll is a list such as
clojure.lang.PersistentList, then :list is added to the :all-tags entry in
the return value from tag-map.
If coll is an array-map, :array-map is added to the :all-tags entry in the
return value from tag-map:
(tag-map (array-map {"one" 1 "two" 2 "three" 3}))
=>
{:tag :map
:type clojure.lang/PersistentArrayMap[]
:carries-meta? true
:all-tags #{:coll :array-map :map}
:coll-type? true
:map-like? true
:number-type? false
:coll-size 9}
2024-07-06
Atomics (js/Atomics), in case device does not support it.js/Atomics.2024-06-23
tag-map return valuecljs.core/Cons and clojure.lang.Cons with :seqseq? will get tagged with :seq. No colls will get tagged with :list.2024-03-16
2024-02-27
java.util.Collection get a :coll tag in :all-tags entry of result of typetag.core/tag-mapPersistentTreeSet -> :set:all-typetags -> :all-tagsv1.11.0 -> v1.9.02024-02-13
js/ArrayBufferjs/Intl.*js/TypedArray:map-like? entry to result of typetag.core/tag-map#uuid and #inst2023-11-17
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |