From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id BBDDCBC6B for ; Thu, 28 Jun 2007 16:50:22 +0200 (CEST) Received: from ptb-relay03.plus.net (ptb-relay03.plus.net [212.159.14.214]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5SEoMLD026929 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Thu, 28 Jun 2007 16:50:22 +0200 Received: from [80.229.56.224] (helo=beast.local) by ptb-relay03.plus.net with esmtp (Exim) id 1I3vK9-0006uy-9q for caml-list@yquem.inria.fr; Thu, 28 Jun 2007 15:50:21 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] The Implicit Accumulator: a design pattern using optional arguments Date: Thu, 28 Jun 2007 15:44:36 +0100 User-Agent: KMail/1.9.7 References: <200706271314.35134.jon@ffconsultancy.com> <85519A86-E765-4C3A-B292-2F9B150913AC@lrde.epita.fr> <46839DD8.7040200@functionality.de> In-Reply-To: <46839DD8.7040200@functionality.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706281544.36719.jon@ffconsultancy.com> X-Miltered: at discorde with ID 4683CAAE.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; stack:01 vectors:01 stack:01 computations:01 ocaml:01 ocaml:01 frog:98 wrote:01 dynamically:01 caml-list:01 functions:01 functions:01 behaviour:01 argument:02 behaves:02 On Thursday 28 June 2007 12:39:04 Thomas Fischbacher wrote: > Let's take some animated 3d application. You may want to introduce a > dynamically scoped notion of, say, "pre-allocated stack of buffers for > position vectors which behaves like a C stack with respect to functions > temporarily using this for computations", so that all the functions that > call one another during rendering of a frame may use that very same > stack in an orderly fashion (with scoping behaviour just as the C > stack). Still, the existence and visibility of this stack is confined > to some "render-animation" function. Pass the stack as an argument to those functions that need it. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. The OCaml Journal http://www.ffconsultancy.com/products/ocaml_journal/?e