I would like to check if a symbol is defined before trying to access it. Some symbols aren't available on all platforms, so instead of raising an exception, I want to check if it's defined first.
Today we have to do:
begin
addr = Fiddle::Handle.sym("something")
# do something
rescue Fiddle::DLError
end
I want to write this:
if Fiddle::Handle.sym_defined?("something")
addr = Fiddle::Handle.sym("something")
# do something
end
I would like to check if a symbol is defined before trying to access it. Some symbols aren't available on all platforms, so instead of raising an exception, I want to check if it's defined first.
Today we have to do:
I want to write this: