[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
thibaut.barrere at gmail.com
Thu Apr 2 05:56:40 EDT 2009
I believe I need to give you more context about what I'm doing. In Magic
particular) I currently have a single file providing support for WPF,
Silverlight and Windows Forms. I use defined? to determine if one of these
are available and adopt adequate behaviour.
So that's why I run defined?(System::Windows::Forms::Control) inside
Silverlight. I can definitely think about alternatives (such as creating a
specific file for each scenario) - I could do that but I'm trying to stay
with a single file and avoid metaprogramming for the moment as it's much
simpler to test.
So back to the issue, now that I hope you have a clearer understanding of
what I'm doing here.
Using ruby 1.8.6 or ironruby v0.3, running this file through command line
[ruby/ir] my_test.rb doesn't choke:
raise "detected!" if defined?(System::Windows::Forms::Control)
Putting the same code as the first line of app.rb in a silverlight ironruby
MemberAccessException: uninitialized constant System::Windows::Forms
Is there any way to retrieve some accurate info on versioning from inside
silverlight, so that I can make a better report or understand what's
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ironruby-core