Re: byte-array woes

2013-03-04 Thread Frank Siebenlist
I gave it my vote - thanks for trying to fix this issue - FrankS. FrankS (from mobile) On Mar 4, 2013, at 6:30 AM, Karsten Schmidt wrote: > Hi Frank, I've added a patch to CLJ-766 with a potential fix. Also, > Andy F. kindly pointed out that interested parties should vote on that > issue to hel

Re: byte-array woes

2013-03-04 Thread Karsten Schmidt
Hi Frank, I've added a patch to CLJ-766 with a potential fix. Also, Andy F. kindly pointed out that interested parties should vote on that issue to help increase its visibility... Add your 2 cents here (provided you've a CA): http://dev.clojure.org/jira/browse/CLJ-766 Best, K. -- Karsten Schmidt

Re: byte-array woes

2013-03-02 Thread Frank Siebenlist
I just ran into that issue while I was constructing byte-arrays for secure-hash test cases. Ended-up using (byte-array (vector-of :byte 1 2 3 4)) to avoid writing the (byte-array [(byte 1)(byte 2)(byte 3)(byte 4)]). Transparently adding valid byte-number values to a byte-array makes sense and

Re: byte-array woes

2013-03-02 Thread Karsten Schmidt
Thanks, Marko! I'd count this as a sort of bug though... at least in terms of consistency, since it breaks expected behaviour as established by other common array c'tor functions: (int-array [1 2 3]) => ok (long-array [1 2 3]) => ok (float-array [1 2 3]) => ok (double-array [1 2 3]) => ok (byte-ar

Re: byte-array woes

2013-03-02 Thread Marko Topolnik
On Saturday, March 2, 2013 6:22:51 PM UTC+1, Karsten Schmidt wrote: > > Is that a bug or can someone please explain why bytes seem to require > special treatment in Clojure? > Calling it a bug wouldn't be entirely fair since it's a missing feature. I'd say this is filable as an enhancement req

byte-array woes

2013-03-02 Thread Karsten Schmidt
Hi, even though I've using byte arrays many times, I'm still massively confused each time I use them... For example, why does this fail? (byte-array [1 2 3 4]) ClassCastException java.lang.Long cannot be cast to java.lang.Byte clojure.lang.Numbers.byte_array (Numbers.java:1223) I understand int