Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Python's yield, Lisp's call-cc or C's setjmp/longjmp in OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@o...>
Subject: Re: [Caml-list] Python's yield, Lisp's call-cc or C's setjmp/longjmp in OCaml
On Thu, 2003-12-18 at 06:42, wrote:
> On 17 Dec 2003, Falk Hueffner wrote:

> In any case, programming this kind of thing in ML is pretty easy, so I don't
> think we need an extension to the language for yield. callcc is more powerful,
> but I don't like the possibility that making callcc fast penalizes code which
> doesn't use it. We have exceptions and threads already.

Felix provides the converse of yield -- read.
yield returns a value, saving the current position.
Read yields *expecting* a value, saving the current

I'd sure like to know how to do that in (Oca)ML easily
(without using threads).

In particular, take some aritrary program that
reads a structured file 

	read stuff .. do something
	read stuff do something
	if condition
		read stuff ..
		read ...

	for loop .. subroutine calls

and do that in ML 'easily'... I don't think
the transformation is all that easy to do by

(Felix does this transformation mechanically,
so I have an idea what is required, the details
are trivial .. the amount of transforming
is quite laborious though .. and possibly
unreadble .. )

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: