On Tue, 2007-07-10 at 11:25 -0400, Sandro Magi wrote:

> > What do you want?
> 
> Consider an I/O model based on promises/futures with continuations.

Argg .. I sent a reply but it went to you, not the list .. my bad :)

At present the I/O model is based on calls which block fthreads:
there are no promises.

But you can easily construct them roughly like this:

        var channel = ...
        spawn_fthread { block(); write (channel,..); };
        stuff();        
        read channel;

Now we have a user extensible parser, making sugar for this
is possible.

The above code is a bit nasty because the channel remains
in scope: you really want something like you suggested:

        fork 
                block();
        and
                stuff();
        join;


I can easily add that to the language now, with the new
user extensible grammar ..:) [well .. the 'and' keyword
is a bit problematical]

Closer to the form you suggested:

        fetch bytes = block () then
                stuff-which-cannot-see-bytes
        join 
                now-bytes-is-visible


Note 'block' cannot be a function. Felix functions are
not allowed to have side-effects. Generators look like
functions but can have side effects. 


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to