Hi Leonel,
On Mon, Oct 31, 2011 at 6:46 AM, Leonel Rocha <[email protected]> wrote:
> I tried to use source.shutdown(out) in the arguments on_stop of the output
> and in on_done of playlist.once() and got erros on both, always like:
> At line 26, char 27:
> this value has type
> (_)->_
> but it should be a subtype of
> ()->unit
Ok, so it's "only" a matter of how to write the on_stop. The handler
is a functions without an argument, therefore you can't just use
source.shutdown, which expects one argument (the active source to
shutdown). This is what the type error is saying.
Now, the bigger problem for writing the handler is that we can't
designate the output because it hasn't been built yet. So we're going
to use a trick: call a dummy function, and replace this dummy function
once the source has been defined:
f = ref { () }
output = output.xxx(...,on_stop={ f = !f ; f() },...)
f := { source.shutdown(output) }
Let us know how this works. (The current brainstorming on OO-style
should include such examples and try to make them more natural.)
Cheers,
--
David
------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook
in minutes. BlackBerry App World™ now supports Android™ Apps
for the BlackBerry® PlayBook™. Discover just how easy and simple
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users