Browse thread
[Caml-list] Python's yield, Lisp's call-cc or C's setjmp/longjmp in OCaml
-
Nuutti Kotivuori
- Oleg Trott
- Ville-Pertti Keinonen
- Brian Hurt
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Brian Hurt <bhurt@s...> |
| Subject: | Re: [Caml-list] Python's yield, Lisp's call-cc or C's setjmp/longjmp in OCaml |
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