1.3.0 permalink Arrow_down_16x16
  • (byte x)
Coerce to byte

1 Example top

  • user=> (def x (byte-array [(byte 0x43) 
                               (byte 0x6c)
                               (byte 0x6f)
                               (byte 0x6a)
                               (byte 0x75)
                               (byte 0x72)
                               (byte 0x65)
                               (byte 0x21)]))
    #'user/x
    
    user=> (String. x)
    "Clojure!"
    
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:3090 top

(defn byte
  "Coerce to byte"
  {:inline (fn  [x] `(. clojure.lang.RT (~(if *unchecked-math* 'uncheckedByteCast 'byteCast) ~x)))
   :added "1.0"}
  [^Number x] (clojure.lang.RT/byteCast x))
Vars in clojure.core/byte:
Used in 0 other vars

Comments top

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