ur=> (map #(Integer/parseInt % 16) ["ff43" "0032"])
(65347 50)
...that yields, not shorts.
At the risk of diverging from the question: why are you concerned with
the specific type of the number?
You realize that Java doesn't allocate less memory for a short than
for an int, right? The only time it becomes more efficient is when you
have a primitive array, in which case the JVM might pack the values.
This is not a primitive array.
On a related note: if I have the symbol for a type, like "short" or
"int" or "byte", is there a way to ask Clojure what size word that
represents?
In Java, byte/char/short/int are all represented the same: 32 bits.
Long is 64.
If you mean "how many octets would this take to represent in C":
(def word-size {'short 2 'byte 1 'int 4 'long 8})
user=> (word-size 'short)
2
but that's hardly a correct answer in the broadest scope.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
To unsubscribe, reply using "remove me" as the subject.