On Wed, May 20, 2009 at 12:36 AM, Romain Beauxis <[email protected]>wrote:

>  Nono, it is still present, but I think you are confused by the (rather
> dumb)
> server interface. The command for stop should be issued with the following
> code:
>  server.execute("id.stop")
>
> Hence, a correct code in your case should be:
>
> l_sources = [root, ogg]
>
> def kickall(_) =
>   def stop(s) =
>    server.execute("#{source.id(s)}.stop")
>  end
>  list.iter(stop, l_sources)
>  "done"
> end
>
> Romain
>

Hmm, I tried that code eventually, but all I get is errors:

At line 156, char 12:
  this value has type
    (((source)->unit), [source])->unit
  but it should be a subtype of
    (((source)->[string]), [source])->?A

At line 156, char 17:
  this value has type
    (source)->[string]
    (infered at line 152 char 3 - line 154 char 5)
  but it should be a subtype of
    (source)->unit

At line 153, char 19-42:
  this value has type
    [string]
  but it should be a subtype of
    unit

This is my code with line numbers:

147 l_sources = [root, ogg]

151 def kickall(_) =
152   def stop(s) =
153     server.execute("#{source.id(s)}.stop")
154   end
155
156   list.iter(stop, l_sources)
157   "done"
158 end

My guess is, that the return value of server.execute is the problem. Is
there a way how I can cast the return value to Unit?

Thanks in advance,

--polemon
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to