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] [ANN] The Missing Library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-29 (02:35)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] [ANN] The Missing Library
On Thu, 2004-04-29 at 11:56, Jon Harrop wrote:
> On Thursday 29 April 2004 2:03 am, skaller wrote:
> > You are missing the point.
> I sure am. ;-)
> > Neither solution control inverts.
> Does that mean that my function is being called by map, rather than having my 
> function explicitly fetch the next element?


> > So they're both weak.
> By this, do you mean that "control inverted" functions are more generic?

The control inverted (thread-of-control) solution allows
to use the stack in the traditional way. For example
recursion.  So it can solve at least context free

A callback with finite state object is clearly limited
to finite state machine: can only solve regular

Of course you can build more complex state object in both
cases to generalise. The point of the algorithmic
solution is that at least some of that state
can be expressed naturally with lexical scoping
and control flow.

I suggest you consider some C program which processes
files .. and rewrite it now please to be a callback

	void accept_character(char x)

and you will see what I mean. This is untenable.

What does the OS do for you? It control inverts.
Most OS swap stacks to do this. This is also
one reason to use threads, unrelated to asynchronicity.

John Skaller,
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language

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