Hi,

On 5 Nov., 15:42, Jochen <joc...@riekhof.de> wrote:

> Thanks for your quick reply!
> I use 1.2.0. aset does not work. It seems that aset is only useable
> for arrays of Reference types, but I need to use primitive types, so
> aset-int is the only option. To me it looks that there should be
> unchecked-xxx versions of the coerce functions (e.g. unchecked-int)
> for this case?!?

Ah. Ok. I see the problem now. You actually want a donut. The value is
not taken verbatim - wrapping around to a negative number - but
promoted to a long. You can exploit the internal representation as a
workaround.

user=> (printf "%x %x\n" 0x80000000 (int (- 0x80000000)))
80000000 80000000
nil
user=> (aset (make-array Integer/TYPE 1) 0 (int (- 0x80000000)))
-2147483648

Sincerely
Meikel

-- 
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

Reply via email to