Changes for clojure.core/type

categorics on Sat, 22 Mar 2014
;; Checking numbers
user=> (type 10)
java.lang.Long

user=> (type 10.0)
java.lang.Double


;; Checking collections
user=> (type [10 20])
clojure.lang.PersistentVector

user=> (type '(10 20))
clojure.lang.PersistentList


;; Checking other, but somewhat intuitive, forms
user=> (type :a)
clojure.lang.Keyword

user=> (type Thread)
java.lang.Class


;; Checking a symbol
user=> (type 'whatever)
clojure.lang.Symbol

;; A surprise attack yields
user=> (type clojure.lang.Symbol)
;; not such a surprising response
java.lang.Class


;; Checking a function
user=> (defn foo [] ("any string"))
#'user/foo
user=> (type foo)
user$foo


;; Checking a macro
user=> (type fn)
user$fn

user=> (type clojure.core/fn)
java.lang.Exception: Can't take value of a macro: #'clojure.core/fn (NO_SOURCE_FILE:94)

ampleyfly on Mon, 02 May 2011
;; Checking numbers
user=> (type 10)
java.lang.Integer

user=> (type 10.0)
java.lang.Double


;; Checking collections
user=> (type [10 20])
clojure.lang.PersistentVector

user=> (type '(10 20))
clojure.lang.PersistentList


;; Checking other, but somewhat intuitive, forms
user=> (type :a)
clojure.lang.Keyword

user=> (type Thread)
java.lang.Class


;; Checking a symbol
user=> (type 'whatever)
clojure.lang.Symbol

;; A surprise attack yields
user=> (type clojure.lang.Symbol)
;; not such a surprising response
java.lang.Class


;; Checking a function
user=> (defn foo [] ("any string"))
#'user/foo
user=> (type foo)
user$foo


;; Checking a macro
user=> (type fn)
user$fn

user=> (type clojure.core/fn)
java.lang.Exception: Can't take value of a macro: #'clojure.core/fn (NO_SOURCE_FILE:94)

zkim on Sun, 26 Sep 2010
;; Checking numbers
user=> (type 10)
java.lang.Integer

user=> (type 10.0)
java.lang.Double


;; Checking collections
user=> (type [10 20])
clojure.lang.PersistentList

user=> (type '(10 20))
clojure.lang.PersistentVector


;; Checking other, but somewhat intuitive, forms
user=> (type :a)
clojure.lang.Keyword

user=> (type Thread)
java.lang.Class


;; Checking a symbol
user=> (type 'whatever)
clojure.lang.Symbol

;; A surprise attack yields
user=> (type clojure.lang.Symbol)
;; not such a surprising response
java.lang.Class


;; Checking a function
user=> (defn foo [] ("any string"))
#'user/foo
user=> (type foo)
user$foo


;; Checking a macro
user=> (type fn)
user$fn

user=> (type clojure.core/fn)
java.lang.Exception: Can't take value of a macro: #'clojure.core/fn (NO_SOURCE_FILE:94)

belun on Mon, 13 Sep 2010
Checking numbers

user=> (type 10)
java.lang.Integer

user=> (type 10.0)
java.lang.Double


Checking collections

user=> (type [10 20])
clojure.lang.PersistentList

user=> (type '(10 20))
clojure.lang.PersistentVector


Checking other, but somewhat intuitive, forms

user=> (type :a)
clojure.lang.Keyword

user=> (type Thread)
java.lang.Class


Checking a symbol

user=> (type 'whatever)
clojure.lang.Symbol

; A surprise attack yields
user=> (type clojure.lang.Symbol)
; not such a surprising response
java.lang.Class


Checking a function

user=> (defn foo [] ("any string"))
#'user/foo
user=> (type foo)
user$foo


Checking a macro

user=> (type fn)
user$fn

user=> (type clojure.core/fn)
java.lang.Exception: Can't take value of a macro: #'clojure.core/fn (NO_SOURCE_FILE:94)