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 SAA03167; Tue, 16 Dec 2003 18:40:58 +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 SAA03175 for ; Tue, 16 Dec 2003 18:40:57 +0100 (MET) Received: from herd.plethora.net (herd.plethora.net [205.166.146.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hBGHeuX21118 for ; Tue, 16 Dec 2003 18:40:56 +0100 (MET) Received: from bhurt.plethora.net (bhurt.plethora.net [205.166.146.49]) by herd.plethora.net (8.11.6/8.10.1) with ESMTP id hBGHeoT08143; Tue, 16 Dec 2003 11:40:50 -0600 (CST) Date: Tue, 16 Dec 2003 12:42:04 -0600 (CST) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: Nuutti Kotivuori cc: caml-list@inria.fr Subject: Re: [Caml-list] Python's yield, Lisp's call-cc or C's setjmp/longjmp in OCaml In-Reply-To: <87n09sucr9.fsf@naked.iki.fi> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 python's:01 lisp's:01 c's:01 generic:01 python's:01 lisp's:01 c's:01 ocaml's:01 ocaml:01 ocaml:01 continuation:02 variant:02 first-class:02 wrote:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 16 Dec 2003, Nuutti Kotivuori wrote: > I am wondering, does OCaml provide any variant of being able to > bypass the normal function call and return discipline? > > More or less generic implementations of this can be seen in for > example Python's yield instruction, Lisp's call-cc or call with > current continuation, or C's setjmp/longjmp. By my measurements, Ocaml's exceptions are faster than C's setjmp/longjmp. Ocaml doesn't provide first-class continuations, but most of the things people actually do with call-cc can be done in other ways in Ocaml. I don't know what Python's yield instruction does. > > And if not, what are the chances of something like that seeing the > light of day in the future? Are there any fundamental problems in > OCaml that would make the implementation of such a thing exceedingly > difficult? What do you want to do? -- "Usenet is like a herd of performing elephants with diarrhea -- massive, difficult to redirect, awe-inspiring, entertaining, and a source of mind-boggling amounts of excrement when you least expect it." - Gene Spafford Brian ------------------- 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