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 OAA14121; Wed, 19 Nov 2003 14:26:36 +0100 (MET) 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 OAA13959 for ; Wed, 19 Nov 2003 14:26:34 +0100 (MET) Received: from mail1.tpgi.com.au (mail.tpgi.com.au [203.12.160.57]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hAJDQW114369 for ; Wed, 19 Nov 2003 14:26:32 +0100 (MET) Received: from 203-213-84-84-syd-ts16-2600.tpgi.com.au (203-213-84-84-syd-ts16-2600.tpgi.com.au [203.213.84.84]) by mail1.tpgi.com.au (8.11.6/8.11.6) with ESMTP id hAJDQN500508; Thu, 20 Nov 2003 00:26:23 +1100 Subject: Re: [Caml-list] GC and file descriptors From: skaller Reply-To: skaller@ozemail.com.au To: Ville-Pertti Keinonen Cc: Brian Hurt , Caml Mailing List In-Reply-To: <20031118200209.GA549@exomi.com> References: <1069092899.17437.58.camel@pelican> <20031118120517.GA881@exomi.com> <1069168782.18363.90.camel@pelican> <20031118200209.GA549@exomi.com> Content-Type: text/plain Message-Id: <1069244753.23700.17.camel@pelican> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 19 Nov 2003 23:25:53 +1100 Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 ozemail:01 1100,:01 python:01 closures:01 python:01 lexically:01 closures:01 scopes:01 lexically:01 hacks:01 scopes:01 stackless:01 passing:01 stackless:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 2003-11-19 at 07:02, Ville-Pertti Keinonen wrote: > On Wed, Nov 19, 2003 at 02:19:42AM +1100, skaller wrote: > > You haven't seen Python 2.2? Its a genuine functional > > programming language now, with full lexical scoping, > > closures, and even some advanced concepts like > > iterators which cannot be programmed in Ocaml. > > AFAIK (correct me if I'm wrong!) Python still doesn't have > conventional lexical scoping. You're wrong :-) Functions can be nested in Python 2.2, and they're lexically scoped. You can even do this: def f(): x = 1 def g(): return x return g and it will work correctly: closures work fine. What doesn't work the way *I* would expect is that class scopes are not lexically scoped. I had an argument with Guido on that -- it would break some arcane hacks he said. > Each scope is a dictionary, No. Function scopes are basically static, there's no locals() dictionary. More precisely there is, but no declared (manifest) local variables are ever in it. > > Stackless Python provides the full continuation > > passing (and Felix provides procedural continuations) > > so they're both ahead of Ocaml as functional languages > > on that score :-) > > Stackless Python is a very interesting concept. One of the things > I'm interested in generally is how a continuation-based, stackless, > natively compiled execution model could work out with modern > programming languages. That's Felix:-) [Well, it uses procedural resumptions, functions just use the stack though -- i might fix that if a few people join the project and think it would be useful: it's not done for efficiency reasons] 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