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 NAA14860; Wed, 25 Aug 2004 13:13:34 +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 NAA15339 for ; Wed, 25 Aug 2004 13:13:33 +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.13.0/8.13.0) with ESMTP id i7PBDUjG029879 for ; Wed, 25 Aug 2004 13:13:32 +0200 Received: from [192.168.1.200] (ppp212-216.lns2.syd3.internode.on.net [203.122.212.216]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i7PBDB4Y087800; Wed, 25 Aug 2004 20:43:12 +0930 (CST) Subject: Re: [Caml-list] Continuations From: skaller Reply-To: skaller@users.sourceforge.net To: Nathaniel Gray Cc: =?ISO-8859-1?Q?S=E9bastien?= Hinderer , caml-list@pauillac.inria.fr In-Reply-To: References: <20040813212722.GA1158@galois> <1093330050.15255.417.camel@pelican.wigram> Content-Type: text/plain Message-Id: <1093432390.15255.558.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 25 Aug 2004 21:13:11 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 412C745A.000 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 2004:99 sourceforge:01 32,:01 python:01 python:01 swept:99 'read:01 9660:01 glebe:01 supported:01 nsw:01 caltech:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 2004-08-25 at 08:18, Nathaniel Gray wrote: > On 24 Aug 2004 16:47:31 +1000, skaller wrote: > > On Tue, 2004-08-24 at 08:32, Nathaniel Gray wrote: > > > > > I wrote a "simple" tutorial on continuations that you might try > > > reading. You can find it here: > > > http://mojave.caltech.edu/papers/cont-tut.ps > > > > > > Let me know if there is anything that you think could be improved in > > > terms of clarity. > > > > This is a nice article to read if you know Python. > > The intention was that that wouldn't matter. :-) That's easy for a Python programmer to say. However I suggest you pick some language you don't know and have someone tell you how it works then look at some code... sure, you can figure out what it does -- painfully -- but you can't *see* what it does. Which you can for a language you're familiar with. I think it's like driving a car. Knowing the theory is different to being able to do everything automatically. > As you and several others have pointed out, I may have > swept too much under the rug. I wouldn't want to go thru the agony of CPS transforming some code to avoid stacks -- only to find the result just used a list instead :) > I suppose you could put any non-recursive (or tail-recursive) > sub-computation on the stack. That would preclude the use of CPS to > support microthreading, however. Ah no, but it doesn't! Felix has an explicit yield operator 'read event', it can only be used in procedures, not in functions. So functions are stackable, whilst procedures are not -- context switching isn't supported in functional code, only in procedural code. Perhaps that seems like an onerous restriction, but it in theory it isn't -- functions aren't allowed to have side effects.. and reading data has a definite side effect. -- 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