Thibaut Barrère
2009-Apr-01 20:08 UTC
[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
Hi, I noticed something that I didn''t expect while working with Silverlight. defined?(System::Windows::Forms::Control) throws an exception: MemberAccessException: uninitialized constant System::Windows::Forms ? IronRuby.Builtins.ModuleOps.ConstantMissing(RubyModule self, String name) ? _stub_$2##1(Closure , CallSite , CodeContext , RubyModule , SymbolId ) ? System.Scripting.Actions.MatchCaller.Call3[T0,T1,T2,TRet](Func`5 target, CallSite site, Object[] args) ? System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) ? System.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) ? IronRuby.Builtins.RubySites.ModuleConstMissing(CodeContext context, RubyModule self, String name) The same call under ir.exe will work as expected in MRI. Can anyone else reproduce that issue (or is it something known already), or is my silverlight install messing up ? cheers, -- Thibaut
Jb Evain
2009-Apr-01 22:35 UTC
[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
On 4/1/09, Thibaut Barr?re <thibaut.barrere at gmail.com> wrote:> Can anyone else reproduce that issue (or is it something known > already), or is my silverlight install messing up ?Well, there''s no System.Windows.Froms.Control in silverlight to begin with. defined?(System::Windows::Application) does work though. -- Jb Evain <jb at nurv.fr>
Jb Evain
2009-Apr-01 22:39 UTC
[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
On 4/2/09, Jb Evain <jb at nurv.fr> wrote:> defined?(System::Windows::Application) > > does work though.At least it works in the IronRuby repl. But trying to get a undefined namespace doesn''t throw an exception either. How''re you running the code? -- Jb Evain <jb at nurv.fr>
Jimmy Schementi
2009-Apr-01 23:13 UTC
[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
System::Windows::Forms doesn''t exist in Silverlight. You want System::Windows::Controls.> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Thibaut Barr?re > Sent: Wednesday, April 01, 2009 1:08 PM > To: ironruby-core > Subject: [Ironruby-core] defined?(xxx) behaves differently when called > from Silverlight > > Hi, > > I noticed something that I didn''t expect while working with > Silverlight. > > defined?(System::Windows::Forms::Control) > > throws an exception: > > MemberAccessException: uninitialized constant System::Windows::Forms > ? IronRuby.Builtins.ModuleOps.ConstantMissing(RubyModule self, > String name) > ? _stub_$2##1(Closure , CallSite , CodeContext , RubyModule , > SymbolId ) > ? System.Scripting.Actions.MatchCaller.Call3[T0,T1,T2,TRet](Func`5 > target, CallSite site, Object[] args) > ? System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] > args) > ? > System.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallS > ite > site, T0 arg0, T1 arg1, T2 arg2) > ? IronRuby.Builtins.RubySites.ModuleConstMissing(CodeContext > context, RubyModule self, String name) > > The same call under ir.exe will work as expected in MRI. > > Can anyone else reproduce that issue (or is it something known > already), or is my silverlight install messing up ? > > cheers, > > -- Thibaut > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core
Jimmy Schementi
2009-Apr-01 23:15 UTC
[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
Granted, it shouldn''t throw ... and doesn''t for me in SL. rb> defined?(System::Windows::Forms) => nil rb> defined?(System::Windows::Forms::Controls) => nil> -----Original Message----- > From: Jimmy Schementi > Sent: Wednesday, April 01, 2009 4:13 PM > To: ironruby-core at rubyforge.org > Subject: RE: [Ironruby-core] defined?(xxx) behaves differently when > called from Silverlight > > System::Windows::Forms doesn''t exist in Silverlight. You want > System::Windows::Controls. > > > -----Original Message----- > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > > bounces at rubyforge.org] On Behalf Of Thibaut Barr?re > > Sent: Wednesday, April 01, 2009 1:08 PM > > To: ironruby-core > > Subject: [Ironruby-core] defined?(xxx) behaves differently when > called > > from Silverlight > > > > Hi, > > > > I noticed something that I didn''t expect while working with > > Silverlight. > > > > defined?(System::Windows::Forms::Control) > > > > throws an exception: > > > > MemberAccessException: uninitialized constant System::Windows::Forms > > ? IronRuby.Builtins.ModuleOps.ConstantMissing(RubyModule self, > > String name) > > ? _stub_$2##1(Closure , CallSite , CodeContext , RubyModule , > > SymbolId ) > > ? System.Scripting.Actions.MatchCaller.Call3[T0,T1,T2,TRet](Func`5 > > target, CallSite site, Object[] args) > > ? System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] > > args) > > ? > > > System.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallS > > ite > > site, T0 arg0, T1 arg1, T2 arg2) > > ? IronRuby.Builtins.RubySites.ModuleConstMissing(CodeContext > > context, RubyModule self, String name) > > > > The same call under ir.exe will work as expected in MRI. > > > > Can anyone else reproduce that issue (or is it something known > > already), or is my silverlight install messing up ? > > > > cheers, > > > > -- Thibaut > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core
Curt Hagenlocher
2009-Apr-01 23:33 UTC
[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
It seems to me that this misses the most important part of the original report:> The same call under ir.exe will work as expected in MRI.Presumably, System::Windows::Forms doesn''t exist in MRI, either :P -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Wednesday, April 01, 2009 4:13 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] defined?(xxx) behaves differently when called from Silverlight System::Windows::Forms doesn''t exist in Silverlight. You want System::Windows::Controls.> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Thibaut Barr?re > Sent: Wednesday, April 01, 2009 1:08 PM > To: ironruby-core > Subject: [Ironruby-core] defined?(xxx) behaves differently when called > from Silverlight > > Hi, > > I noticed something that I didn''t expect while working with > Silverlight. > > defined?(System::Windows::Forms::Control) > > throws an exception: > > MemberAccessException: uninitialized constant System::Windows::Forms > ? IronRuby.Builtins.ModuleOps.ConstantMissing(RubyModule self, > String name) > ? _stub_$2##1(Closure , CallSite , CodeContext , RubyModule , > SymbolId ) > ? System.Scripting.Actions.MatchCaller.Call3[T0,T1,T2,TRet](Func`5 > target, CallSite site, Object[] args) > ? System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] > args) > ? > System.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallS > ite > site, T0 arg0, T1 arg1, T2 arg2) > ? IronRuby.Builtins.RubySites.ModuleConstMissing(CodeContext > context, RubyModule self, String name) > > The same call under ir.exe will work as expected in MRI. > > Can anyone else reproduce that issue (or is it something known > already), or is my silverlight install messing up ? > > cheers, > > -- Thibaut > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core_______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Thibaut Barrère
2009-Apr-02 09:56 UTC
[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
Hi, I believe I need to give you more context about what I''m doing. In Magic (see here<http://github.com/thbar/magic/blob/faf98c3161221e309290e7a6e311adb27fddf825/lib/magic.rb#L32> in 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 app fails: 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 happening ? -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090402/f5c3556c/attachment.html>
Jimmy Schementi
2009-Apr-02 10:43 UTC
[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
The folder SL is installed into is the version; if you''re using SL2 it should be C:\Program Files\Microsoft Silverlight\2.0.40115.0\. SL3 Beta is C:\Program Files\Microsoft Silverlight\3.0.40307.0\. http://jimmy.schementi.com/silverlight/repro-defined.zip Unzip that and double-click on the index.html file. The first line of app.xap is defined?(System::Windows::Forms), and works fine. It also works in the console. Let me know what happens for you. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Thursday, April 02, 2009 2:57 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] defined?(xxx) behaves differently when called from Silverlight Hi, I believe I need to give you more context about what I''m doing. In Magic (see here<http://github.com/thbar/magic/blob/faf98c3161221e309290e7a6e311adb27fddf825/lib/magic.rb#L32> in 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 app fails: 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 happening ? -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090402/ab7ad2d6/attachment.html>
Thibaut Barrère
2009-Apr-02 22:44 UTC
[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
> > The folder SL is installed into is the version; if you?re using SL2 it > should be C:\Program Files\Microsoft Silverlight\2.0.40115.0\. SL3 Beta is > C:\Program Files\Microsoft Silverlight\3.0.40307.0\. >I''m testing this from my Mac. I''ll be searching for the files using find.> > > http://jimmy.schementi.com/silverlight/repro-defined.zip > > > > Unzip that and double-click on the index.html file. The first line of > app.xap is defined?(System::Windows::Forms), and works fine. It also works > in the console. Let me know what happens for you. >Clicking on index.html shows a welcome message and the ironruby console, so it doesn''t seem to bang. Editing has some weird behaviour: when I type (, defined? gets erased. Maybe totally unrelated, but this mean I can''t test in the console. I''m a bit puzzled as why it fails. I''ll try to find some extra time to investigate - may be related to the fact that I''m using Chiron on Mac ? No idea what''s happening for the moment. Thanks for the repro, Jimmy. -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090403/62f801dc/attachment.html>
Thibaut Barrère
2009-Apr-02 23:31 UTC
[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
Hey, I finally removed all the bits of Silverlight (/Library/Internet Plug-Ins/Silverlight* , /Library/Receipts/Silverlight*.pkg) and reinstalled SL2. It now works as expected. I didn''t find some way to understand what really happened, but the issue is solved anyway. thanks for your support, -- Thibaut
Jimmy Schementi
2009-Apr-02 23:58 UTC
[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
Ah, you were on a Mac. Let me know if it happens again.> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Thibaut Barr?re > Sent: Thursday, April 02, 2009 4:31 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] defined?(xxx) behaves differently when > called from Silverlight > > Hey, > > I finally removed all the bits of Silverlight (/Library/Internet > Plug-Ins/Silverlight* , /Library/Receipts/Silverlight*.pkg) and > reinstalled SL2. > > It now works as expected. I didn''t find some way to understand what > really happened, but the issue is solved anyway. > > thanks for your support, > > -- Thibaut > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core
Jimmy Schementi
2009-Apr-03 00:59 UTC
[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Thursday, April 02, 2009 3:44 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] defined?(xxx) behaves differently when called from Silverlight The folder SL is installed into is the version; if you''re using SL2 it should be C:\Program Files\Microsoft Silverlight\2.0.40115.0\. SL3 Beta is C:\Program Files\Microsoft Silverlight\3.0.40307.0\. I''m testing this from my Mac. I''ll be searching for the files using find. http://jimmy.schementi.com/silverlight/repro-defined.zip Unzip that and double-click on the index.html file. The first line of app.xap is defined?(System::Windows::Forms), and works fine. It also works in the console. Let me know what happens for you. Clicking on index.html shows a welcome message and the ironruby console, so it doesn''t seem to bang. Editing has some weird behaviour: when I type (, defined? gets erased. Maybe totally unrelated, but this mean I can''t test in the console. I''m a bit puzzled as why it fails. I''ll try to find some extra time to investigate - may be related to the fact that I''m using Chiron on Mac ? No idea what''s happening for the moment. Thanks for the repro, Jimmy. -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090403/a56d9cf8/attachment.html>
Jimmy Schementi
2009-Apr-03 01:02 UTC
[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
Woops, hit send too soon. I just tested it out on a Mac in FF3 and Safari3, and nothing blew up and the console rendered fine. You''re future mail said things work, so I guess I''m just confirming that your prior installation was all-sorts-of-crazy. Also, Chiron on the Mac wouldn''t cause this, as Chiron simply serves a XAP file, and has nothing to do with the actual running of the SL app. ~js From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Thursday, April 02, 2009 3:44 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] defined?(xxx) behaves differently when called from Silverlight The folder SL is installed into is the version; if you''re using SL2 it should be C:\Program Files\Microsoft Silverlight\2.0.40115.0\. SL3 Beta is C:\Program Files\Microsoft Silverlight\3.0.40307.0\. I''m testing this from my Mac. I''ll be searching for the files using find. http://jimmy.schementi.com/silverlight/repro-defined.zip Unzip that and double-click on the index.html file. The first line of app.xap is defined?(System::Windows::Forms), and works fine. It also works in the console. Let me know what happens for you. Clicking on index.html shows a welcome message and the ironruby console, so it doesn''t seem to bang. Editing has some weird behaviour: when I type (, defined? gets erased. Maybe totally unrelated, but this mean I can''t test in the console. I''m a bit puzzled as why it fails. I''ll try to find some extra time to investigate - may be related to the fact that I''m using Chiron on Mac ? No idea what''s happening for the moment. Thanks for the repro, Jimmy. -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090403/fbd35b23/attachment-0001.html>
Vaibhav Deshpande
2009-Apr-03 15:25 UTC
[Ironruby-core] defined?(xxx) behaves differently when called from Silverlight
Jb Evain wrote:> On 4/1/09, Thibaut Barr? <thibaut.barrere at gmail.com> wrote: >> Can anyone else reproduce that issue (or is it something known >> already), or is my silverlight install messing up ? > > Well, there''s no System.Windows.Froms.Control in silverlight to begin > with. > > defined?(System::Windows::Application) > > does work though.-- Posted via http://www.ruby-forum.com/.