From mboxrd@z Thu Jan 1 00:00:00 1970 X-Sympa-To: caml-list@inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q32Fiqr0012515 for ; Mon, 2 Apr 2012 17:44:52 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqgCAIrIeU/RVdW2fWdsb2JhbABFhUehdpFLCCIBAQsHAg0HFAQjggkBAQEEEgIPHQEBLAsBDwsLAwoCAgkdAgIhARIBBQEKEgYTEhCHZwuceQqKWm6DPwGOKgaBL4hnhW6BGJVlgRGKIoMdPYQK X-IronPort-AV: E=Sophos;i="4.75,357,1330902000"; d="scan'208";a="152343463" Received: from mail-yx0-f182.google.com ([209.85.213.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 02 Apr 2012 17:44:46 +0200 Received: by yenl9 with SMTP id l9so1892206yen.27 for ; Mon, 02 Apr 2012 08:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=h8RCWGq7TxW/uQCgmunZVpBY8CsEST1oMUhIZy300mk=; b=BcleqLSgeswdxGd7MwOT/yyQ6hvWw0+3kfQIW55qH7rvV/MFnkqUKJ9+uPvD4cPtDF DAEfErrTGkRCBMu1xnRqmrlxY9FDw5a892d/j1YbWFOY35qAAg/ug3bkjvGi7uPP77OH YQ75aQELJgQtbo1/cSr4H2V2A6UrocFBsvP7B5e0yH0aYpmeFgf5blI8miPHfqhQa54i AMIX/tlIrojFyqtJ2/n91Mr5nASUJKmlHFn4edQmbfvP+2c9h1AFSyidAXWwPiWPZWkW o4kK7SAAa619jK6/rLXzdZo1r2Qp52vY/o0Lj48V67ffIhPTP21BDtDyfcibw0peeJPY I5vA== MIME-Version: 1.0 Received: by 10.50.216.232 with SMTP id ot8mr7269662igc.22.1333381485285; Mon, 02 Apr 2012 08:44:45 -0700 (PDT) Received: by 10.231.205.204 with HTTP; Mon, 2 Apr 2012 08:44:45 -0700 (PDT) In-Reply-To: <4F79B858.2090502@gmail.com> References: <4F79B858.2090502@gmail.com> Date: Mon, 2 Apr 2012 16:44:45 +0100 Message-ID: From: Benedikt Grundmann To: Hongbo Zhang Cc: Caml List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id q32Fiqr0012515 X-Validation-by: benedikt.grundmann@googlemail.com Subject: Re: [Caml-list] How could I implement an efficient ring buffer? Use core's Dequeue module. Cheers, Bene On 2 April 2012 15:31, Hongbo Zhang wrote: > Hi List, >   I want to implement sliding window algorithm (in place, no memory copy), I > wonder whether I need to write c code. > >   To make it clear and simple, >      In c, you can record the head pointer of the array, and do the modulo > operations when get and set >      In ocaml, it seems you have an array a of type int array,  you can not > do things like this *(&a+5). >   Many thanks > > > -- > Caml-list mailing list.  Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- Calvin: I try to make everyone's day a little more surreal. (From Calvin & Hobbes)