Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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?

Yes.

> > 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
problems.

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

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, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language 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