Re: Bitfields access in Clojure

2009-07-24 Thread Daniel Janus
> > Up to eight elements in a literal map are stored > > as array-map. An array-map keeps the key ordering. > > For more elements the map becomes a hash-map, > > which does not keep the key ordering. > > I assume that's an implementation detail that one could not rely on, > though, right? Yeah,

Re: Bitfields access in Clojure

2009-07-24 Thread Michael Wood
2009/7/22 Meikel Brandmeyer : > Hi, > > Am 22.07.2009 um 18:42 schrieb Paul Mooser: > >> Is it safe to assume that you can extract the key ordering from the >> literal map the user specified ? Or am I misunderstanding ? > > Up to eight elements in a literal map are stored > as array-map. An array-

Re: Bitfields access in Clojure

2009-07-22 Thread Meikel Brandmeyer
Hi, Am 22.07.2009 um 18:42 schrieb Paul Mooser: Is it safe to assume that you can extract the key ordering from the literal map the user specified ? Or am I misunderstanding ? Up to eight elements in a literal map are stored as array-map. An array-map keeps the key ordering. For more elements

Re: Bitfields access in Clojure

2009-07-22 Thread Paul Mooser
Is it safe to assume that you can extract the key ordering from the literal map the user specified ? Or am I misunderstanding ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, se

Re: Bitfields access in Clojure

2009-07-22 Thread Daniel Janus
On 22 Lip, 09:52, Timothy Pratley wrote: > Could you give a more detailed example to illustrate what this means? > > >   (with-bitfields arr 0 {last 1, term 1, dest 22, char 8} > >     [last term dest char]) Perhaps a good illustration will be what it macroexpands to: (let [last (+ (bit-and (ag

Re: Bitfields access in Clojure

2009-07-22 Thread Timothy Pratley
Could you give a more detailed example to illustrate what this means? >   (with-bitfields arr 0 {last 1, term 1, dest 22, char 8} >     [last term dest char]) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure"

Bitfields access in Clojure

2009-07-21 Thread Daniel Janus
Dear list, [I apologize in advance if this gets posted twice.] Having a free day on my hands, I finally got around to writing some nontrivial code in Clojure. The result happens to be a library that I hope might be useful to someone else besides me. It's called clj- bitfields and consists of one

Bitfields access in Clojure

2009-07-21 Thread Daniel Janus
Dear list, Having a free day on my hands, I finally got around to writing some nontrivial code in Clojure. The result happens to be a library that I hope might be useful to someone else besides me. It's called clj- bitfields and consists of one macro, with-bitfields, that allow you to say things