Browse thread
[Caml-list] [ANN] The Missing Library
-
John Goerzen
-
Kenneth Knowles
- Alexander V. Voinov
-
John Goerzen
-
Maxence Guesdon
-
John Goerzen
- Maxence Guesdon
-
John Goerzen
-
Alain.Frisch@e...
-
John Goerzen
-
Alain.Frisch@e...
-
Nicolas Cannasse
-
Yamagata Yoriyuki
- Gerd Stolpmann
-
Nicolas Cannasse
-
Yamagata Yoriyuki
- Jacques GARRIGUE
- Nicolas Cannasse
-
Yamagata Yoriyuki
-
Yamagata Yoriyuki
-
Nicolas Cannasse
- oliver@f...
-
Alain.Frisch@e...
-
John Goerzen
- Henri DF
- Shawn Wagner
- james woodyatt
-
Alain.Frisch@e...
- Basile STARYNKEVITCH
-
John Goerzen
- Kenneth Knowles
- Florian Hars
-
Maxence Guesdon
- Eric C. Cooper
-
Kenneth Knowles
[
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: | 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