From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 8583CBC37 for ; Thu, 29 Oct 2009 18:11:08 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApcCAL5p6UrZSMDji2dsb2JhbACBT5l5AQEBCgsKBxEFwxKEPQQ X-IronPort-AV: E=Sophos;i="4.44,647,1249250400"; d="scan'208";a="37219393" Received: from fmmailgate02.web.de ([217.72.192.227]) by mail3-smtp-sop.national.inria.fr with ESMTP; 29 Oct 2009 18:11:08 +0100 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate02.web.de (Postfix) with ESMTP id 2029413AF8325 for ; Thu, 29 Oct 2009 18:08:00 +0100 (CET) Received: from [95.208.117.111] (helo=frosties.localdomain) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #314) id 1N3YTf-000182-00 for caml-list@inria.fr; Thu, 29 Oct 2009 18:08:00 +0100 Received: from mrvn by frosties.localdomain with local (Exim 4.69) (envelope-from ) id 1N3YTf-0004iH-Kk for caml-list@inria.fr; Thu, 29 Oct 2009 18:07:59 +0100 From: Goswin von Brederlow To: caml-list@inria.fr Subject: Re: [Caml-list] Re: How to read different ints from a Bigarray? References: <87eiond3of.fsf@frosties.localdomain> <87639zd0m9.fsf@frosties.localdomain> <87tyxj5rkv.fsf@frosties.localdomain> <527cf6bc0910281548s53a00ec9s99402f4249b2d411@mail.gmail.com> <873a52wmu0.fsf@frosties.localdomain> <20091029122043.GA18905@annexia.org> Date: Thu, 29 Oct 2009 18:07:59 +0100 In-Reply-To: <20091029122043.GA18905@annexia.org> (Richard Jones's message of "Thu, 29 Oct 2009 12:20:43 +0000") Message-ID: <87iqdyb028.fsf@frosties.localdomain> User-Agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.22 (linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX18P+tNnEvhgVY7+1nyehpcpI4wZXHKMmbmCFVp8 N/q+2sycd3ZU6agXH/ySVLzuGESWNLl9p8leIMDEkvLAeeQ0R9 MjDOJUQHo= X-Spam: no; 0.00; bigarray:01 0100,:01 foo:01 andrieu:01 syntax:01 2009:98 mfg:98 wrote:01 heap:01 ints:01 caml-list:01 writes:01 reuse:01 data:02 structures:02 Richard Jones writes: > On Thu, Oct 29, 2009 at 10:50:31AM +0100, Goswin von Brederlow wrote: >> but no >> >> let unparse_foo (x, y) = >> bitmake { x : 16 : littleendian; y : 16 : littleendian } x y > > See: > > http://et.redhat.com/~rjones/bitstring/html/Bitstring.html#2_Constructingbitstrings > > I don't necessarily think bitstring is suitable here though because > you still need to read your data into a string (or fake a string on > the C heap as Olivier Andrieu mentioned). I think in this case you'd > be better off just writing this part of the code in C. > > Rich. I still can reuse a lot of this. Esspecially the syntax extension seems like a good idea. Maybe reduced to bytes instead of bits though. I don't intend to use such fine grained structures to need bit access. MfG Goswin