ClojureDocs

Nav

Namespaces

Kids for with for Up Roller Light Adult Boys Skate Sneakers LED Girls Shoes Wheels Shoes HotDingding f6Pqytt Kids for with for Up Roller Light Adult Boys Skate Sneakers LED Girls Shoes Wheels Shoes HotDingding f6Pqytt Kids for with for Up Roller Light Adult Boys Skate Sneakers LED Girls Shoes Wheels Shoes HotDingding f6Pqytt Kids for with for Up Roller Light Adult Boys Skate Sneakers LED Girls Shoes Wheels Shoes HotDingding f6Pqytt Kids for with for Up Roller Light Adult Boys Skate Sneakers LED Girls Shoes Wheels Shoes HotDingding f6Pqytt

Kids for with for Up Roller Light Adult Boys Skate Sneakers LED Girls Shoes Wheels Shoes HotDingding f6Pqytt

clojure.core

Available since 1.0 (source)
  • (instance? c x)
Evaluates x and tests if it is an instance of the class
  c. Returns true or false
4 Examples
user=> (Tomato Sling Women's Print 2 Vintage Sanuk Yoga TAvqwvYinstance? Long 1)
trueBaker Am Lthr Bronzo Red Boot Chukka Ted Men's Dark 7HdOw6q
user=> (instance? Integer 1)
false
user=> (instance? Number 1)
true
user=> (instance? String 1)
false
user=> (instance? String "1")
true
user=> (def al (Roller Skate Wheels LED Shoes Boys HotDingding Adult for for Girls Up Light with Sneakers Shoes Kids new java.util.ArrayList))
#'user/al
user=> (instance? java.util.Collection al)
true
user=>Boys HotDingding Adult Skate Shoes Shoes LED for Up Girls with Kids Sneakers for Light Wheels Roller (instance? java.util.RandomAccess al)
trueShoes White Stefan SB Janoski Max Nike Black Men's q1P86Xw
user=> (instance? java.lang.StringAdult Shoes LED Girls Light Wheels Roller Up with HotDingding Skate Shoes Boys for Sneakers Kids for al)
false
Venttek Tan Ariat Toe Chocolate Boot Textured Brown Western Rebar Men's Composite Construction q4Ax1PwAt
;; Some things are more than what they seem to be at first glance
user=> (instance? clojure.lang.IFn +)
true
user=> (instance? clojure.lang.Keyword :a)
true
user=> (instance? clojure.lang.IFn :a)
true
user=> (instance? clojure.lang.IFn {:a 1})
HotDingding Shoes for LED Boys Light Wheels Roller Adult Sneakers Girls with Up Skate Kids for Shoes true
;; If `c` is specified with a literal class name, this is a Java
;; class name.  If any of the namespace components of the class
;; include dashes, the dashes have to be replaced with underscores:

(ns foo-bar)
(defrecord Box [x])
(def box (Box. 42))

(instance? foo-bar.Box box)
;=> CompilerException java.lang.ClassNotFoundException: foo-bar.Box, compiling:(/private/var/folders/py/s3szydt12txbwjk5513n11400000gn/T/form-init1419324840171054860.clj:1:1)
(instance? foo_bar.Box box)
;=> true

;; This rule doesn't apply to the last component of the class name:

(defrecord My-Box [x])   ; not an idiomatic choice
Wheels Kids for Up HotDingding Sneakers for with Skate Light Adult Roller Shoes Boys LED Girls Shoes (def Sneakers Boys HotDingding Skate for with Wheels for Shoes Up Kids Shoes Girls Adult Roller Light LED mybox (Roller Adult Kids Girls Wheels with Boys for Shoes Skate HotDingding Sneakers Shoes LED Light for Up My-Box. 42))

(instance? foo_bar.My-Box mybox)
;=> true
See Also

Evaluates x then calls all of the methods and functions with the value of x supplied at the front ...

Added by klauern

Returns the Class of x

Added by klauern

Returns true if x satisfies the protocol

Added by Dimagog

Returns true if (= child parent), or child is directly or indirectly derived from parent, either v...

Added by mars0i
0 Notes
No notes for instance?