You're viewing version 1.2.0 of cast. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16
  • (cast c x)
Throws a ClassCastException if x is not a c, else returns x.

1 Example top

  • user=> (cast Integer 1)  
    1
    
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:289 top

(defn cast
  "Throws a ClassCastException if x is not a c, else returns x."
  {:added "1.0"}
  [^Class c x] 
  (. c (cast x)))
Vars in clojure.core/cast: defn
Used in 3 other vars + * domain

Comments top

No comments for cast. Log in to add a comment.