I don't understand the question. The caller ignores the return value.

Here is an example:

#!/usr/bin/env ruby

require 'xmmsclient'
require 'xmmsclient_glib'
require 'glib2'
begin
    xmms = Xmms::Client.new('test').connect(ENV['XMMS_PATH'])
rescue Xmms::Client::ClientError
    exit
end
xmms.add_to_glib_mainloop
ml = GLib::MainLoop.new(nil, false)
xmms.playback_current_id.notifier do |id|
    if id.zero?
        puts 'There is no current ID.'
    else
        puts "Currently playing ID: #{id}"
    end
    ['siduh', '9e7ryt', 83476, :moo, 83476].uniq!
end
puts 'You will notice that this message is printed before the ID.'
ml.run

Try to run it. You'll get

test.rb:29:in `run': can't convert Array into Integer (TypeError)
        from test.rb:29

error message.

That is. Return value here (playback_current_id.notifier) does nothing
since it'll be executed only once anyway. However it fails.
Because in this case result of this block is
['siduh', '9e7ryt', 83476, :moo]
An array.

The code in the Ruby bindings is this:

ret = (something-that-is-actually-array)

(ret == Qnil || ret == Qfalse)
No.

(ret == Qtrue)
No.

NUM2INT(something-that-is-actually-array)
Wha...

So. Even though return value does not matter it can impact execution.

--
_______________________________________________
Xmms2-devel mailing list
Xmms2-devel@lists.xmms.se
http://lists.xmms.se/cgi-bin/mailman/listinfo/xmms2-devel

Reply via email to