From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id DAA05101; Thu, 29 Apr 2004 03:03:57 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA05094 for ; Thu, 29 Apr 2004 03:03:56 +0200 (MET DST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3T13rjq029668 for ; Thu, 29 Apr 2004 03:03:54 +0200 Received: from [192.168.1.200] (ppp114-169.lns1.syd3.internode.on.net [150.101.114.169]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i3T13mZq076751; Thu, 29 Apr 2004 10:33:48 +0930 (CST) Subject: Re: [Caml-list] [ANN] The Missing Library From: skaller Reply-To: skaller@users.sourceforge.net To: Jon Harrop Cc: caml-list In-Reply-To: <200404281942.05371.jdh30@cam.ac.uk> References: <20040428151818.GC1310@excelhustler.com> <1083169714.9537.1102.camel@pelican.wigram> <200404281942.05371.jdh30@cam.ac.uk> Content-Type: text/plain Message-Id: <1083200626.9537.1199.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 29 Apr 2004 11:03:48 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 sourceforge:01 2004:99 advocating:01 gotos:01 goto's:01 inverted:01 recursion:01 callback:01 model:01 monadic:01 9660:01 glebe:01 bindings:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 2004-04-29 at 04:42, Jon Harrop wrote: > Oh my God, you're not seriously advocating a page of gotos over that are you? Certainly: its a state machine, that's how the work, you can't get around that. However the goto's aren't of consequence here. I you wanted you could use a for loop, or whatever .. > I think you can easily have it either way in ocaml too. For the imperative > style you can use map or iter with a function which has side-effects on some > more global state. For the functional approach you use fold and pass the > state on each time. You are missing the point. Neither solution control inverts. So they're both weak. In the control inverted solution you aren't not called with some state, you do the calling so you can use for example let/bindings and recursion to maintain state "functionally": you cannot do that with the callback driven model, you're forced to use mutable state. In practice not all complex problems admit a clean solution using functional states, you may need some variables too. But at least you can reduce the need to use it if you have control inversion built into your language. Sure like to see a monadic/lazy solution to the example using streams .. -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners