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 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id A1BCFBC6B for ; Fri, 29 Jun 2007 03:16:04 +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 l5T1G44o013215 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 29 Jun 2007 03:16:04 +0200 Received: from [80.229.56.224] (helo=beast.local) by ptb-relay03.plus.net with esmtp (Exim) id 1I455f-0003qk-QV for caml-list@yquem.inria.fr; Fri, 29 Jun 2007 02:16:03 +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: Fri, 29 Jun 2007 02:10:19 +0100 User-Agent: KMail/1.9.7 References: <200706271314.35134.jon@ffconsultancy.com> <20070628172029.GA6796@feanor> <46843252.60608@functionality.de> In-Reply-To: <46843252.60608@functionality.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706290210.19621.jon@ffconsultancy.com> X-Miltered: at discorde with ID 46845D54.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; stack:01 stack:01 threading:01 hmmm:01 ocaml:01 ocaml:01 frog:98 wrote:01 wrote:01 caml-list:01 functions:01 functions:01 precisely:01 awkward:02 argument:02 On Thursday 28 June 2007 23:12:34 Thomas Fischbacher wrote: > Dirk Thierbach wrote: > >>>Pass the stack as an argument to those functions that need it. > >> > >>Precisely this is how you would have to do this with ML. But then, if > >>you do not just deal with one stack, but have more complicated context, > >>OR if you have to start thinking about threading the stack through > >>functions that do not use it, but use other functions which use it, > >>things easily get quite awkward. > > > > So could one "hide the plumbing" in a monad? > > Hmmm. In principle, yes. I think that should be possible here. > (Done this for a related problem where contextual typesetting > information is passed around.) Is this the kind of thing you're after: http://okmij.org/ftp/ML/#dynvar I must confess, I don't see the lure when you have currying... -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. The OCaml Journal http://www.ffconsultancy.com/products/ocaml_journal/?e