I?m trying to derive a class from a .NET class like this: class X < System::Windows::Forms::Form and I get this error message: System.InvalidOperationException: superclass must be a Class (NestedTypeTracker given) Am I missing anything? I?m running the latest IronRuby release. Dermot www.sapphiresteel.com -- Posted via http://www.ruby-forum.com/.
Deriving from CLR class is not supported yet. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Dermot Hogan Sent: Monday, October 08, 2007 5:44 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] trouble with super and .NET classes I?m trying to derive a class from a .NET class like this: class X < System::Windows::Forms::Form and I get this error message: System.InvalidOperationException: superclass must be a Class (NestedTypeTracker given) Am I missing anything? I?m running the latest IronRuby release. Dermot www.sapphiresteel.com -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
OK, thanks. When (approximately) do you expect to support this? Dermot -- Posted via http://www.ruby-forum.com/.
John Messerly from our team is looking into this issue now. Shouldn''t be long ... :) -John> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Dermot Hogan > Sent: Monday, October 08, 2007 10:22 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] trouble with super and .NET classes > > OK, thanks. > > When (approximately) do you expect to support this? > > Dermot > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core
Great! I''m a bit stuck with the Form designer until that works. Do delegates work yet? Dermot -- Posted via http://www.ruby-forum.com/.
Yes - delegates work. Have you gotten success in integrating IronRuby into the VS editor yet? Thanks, -John> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Dermot Hogan > Sent: Monday, October 08, 2007 1:11 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] trouble with super and .NET classes > > Great! > > I''m a bit stuck with the Form designer until that works. > > Do delegates work yet? > > Dermot > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core
The VS editor supports Ruby - it doesn''t care which flavor it is. I can edit and launch IronRuby from the editor just like I can with JRuby or classic Ruby. I can also generate IronRuby code from the Form Designer and generate a Form layout back from the Ruby code. What I can''t do is run the generated IronRuby like you would VB or C# ... that''s why I need the Windows inheritance in IronRuby. The VS Form Designer is very picky and works in a very specific way. You really have to do exactly what it expects you to do. I''ve also got to code the Form Designer merge logic. I haven''t tried the debugger yet. The basics should be reasonably easy, but I suspect the difficult bit will be getting the inspectors to work. I spent a lot of time with Matz''s Ruby getting VS debug expressions (the watch windows and debug data tips) to work correctly. The main problem is that there is no defined syntax for the string returned by inspect - you can return what you like - and there are at least 7 or 8 different formats. The bulk of the work is really stitching the whole thing together - there''s no show stopper in there (but the Form Designer can be a real pita). My problem is that I''m doing this in my spare time - of which I don''t have a lot :( Dermot -- Posted via http://www.ruby-forum.com/.
> Dermot Hogan: > > I can also generate IronRuby code from the Form Designer and generate a > Form layout back from the Ruby code. What I can''t do is run the > generated IronRuby like you would VB or C# ... that''s why I need the > Windows inheritance in IronRuby. The VS Form Designer is very picky and > works in a very specific way. You really have to do exactly what it > expects you to do. I''ve also got to code the Form Designer merge logic.Understood. We''ll need to get this to work.> I haven''t tried the debugger yet. The basics should be reasonably easy, > but I suspect the difficult bit will be getting the inspectors to work. > I spent a lot of time with Matz''s Ruby getting VS debug expressions > (the > watch windows and debug data tips) to work correctly. The main problem > is that there is no defined syntax for the string returned by inspect - > you can return what you like - and there are at least 7 or 8 different > formats.I wouldn''t recommend looking at this until we''ve had a chance to rewrite the scanner in IronRuby. Right now the one that we''re using doesn''t report line / column positions correctly. Once that works, we''ll be able to emit the correct PDBs, which should enable the VS debugger to "just work". Thanks for working on this! -John
Hi Dermot, Do you have any sample Ruby code generated by the Windows Forms designer? I''d like to try it out so I can see what the issues are to get it working. Thanks! John -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (DLR) Sent: Monday, October 08, 2007 2:00 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] trouble with super and .NET classes> Dermot Hogan: > > I can also generate IronRuby code from the Form Designer and generate a > Form layout back from the Ruby code. What I can''t do is run the > generated IronRuby like you would VB or C# ... that''s why I need the > Windows inheritance in IronRuby. The VS Form Designer is very picky and > works in a very specific way. You really have to do exactly what it > expects you to do. I''ve also got to code the Form Designer merge logic.Understood. We''ll need to get this to work.> I haven''t tried the debugger yet. The basics should be reasonably easy, > but I suspect the difficult bit will be getting the inspectors to work. > I spent a lot of time with Matz''s Ruby getting VS debug expressions > (the > watch windows and debug data tips) to work correctly. The main problem > is that there is no defined syntax for the string returned by inspect - > you can return what you like - and there are at least 7 or 8 different > formats.I wouldn''t recommend looking at this until we''ve had a chance to rewrite the scanner in IronRuby. Right now the one that we''re using doesn''t report line / column positions correctly. Once that works, we''ll be able to emit the correct PDBs, which should enable the VS debugger to "just work". Thanks for working on this! -John _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Hi John, Here''s some very simple text: a form, a checkbox and a button with a couple of attributes. I haven''t been able run this in IR at all so I''ve no idea if it will work or not. However, it looks like the sort of thing that the Form Designer produces in C# or VB. Tt does ''round trip'' between the designer and persistant store, so it''s internally consistent - I think :) require ''mscorlib'' require ''System'' require ''System.Windows.Forms'' require ''System.Drawing'' class Form1123 < System::Windows::Forms::Form attr_accessor :checkBox1 attr_accessor :button2 def InitializeComponent self.button2 = System::Windows::Forms::Button.new() self.checkBox1 = System::Windows::Forms::CheckBox.new() self.SuspendLayout() # # button2 # self.button2.Location = System::Drawing::Point.new(79, 113) self.button2.Name = "button2" self.button2.Size = System::Drawing::Size.new(75, 23) self.button2.TabIndex = 0 self.button2.Text = "button2" self.button2.TextAlign = System::Drawing::ContentAlignment.TopCenter self.button2.UseVisualStyleBackColor = true # # checkBox1 # self.checkBox1.Anchor = System::Windows::Forms::AnchorStyles.Top | System::Windows::Forms::AnchorStyles.Bottom | System::Windows::Forms::AnchorStyles.Left self.checkBox1.AutoSize = true self.checkBox1.Location = System::Drawing::Point.new(79, 61) self.checkBox1.Name = "checkBox1" self.checkBox1.Size = System::Drawing::Size.new(90, 17) self.checkBox1.TabIndex = 1 self.checkBox1.Text = "checkBox1" self.checkBox1.TextAlign = System::Drawing::ContentAlignment.TopLeft self.checkBox1.UseVisualStyleBackColor = true # # Form1123 # self.ClientSize = System::Drawing::Size.new(284, 264) self.Controls.Add(self.checkBox1) self.Controls.Add(self.button2) self.Name = "Form1123" self.ResumeLayout(false) self.PerformLayout() end end good luck! Dermot -- Posted via http://www.ruby-forum.com/.
A quick look at the code: Enums are broken today, so that won''t work without some helper library that just returns the enum value. This is on our short list of bugs to fix already. Jomes has already fixed inheritance and will be posting a patch for that soon to unblock you (we''re still going to code review it internally and run it through our testing infrastructure before it gets out). Thanks, -John> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Dermot Hogan > Sent: Monday, October 08, 2007 2:56 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] trouble with super and .NET classes > > Hi John, > > Here''s some very simple text: a form, a checkbox and a button with a > couple of attributes. I haven''t been able run this in IR at all so I''ve > no idea if it will work or not. However, it looks like the sort of > thing > that the Form Designer produces in C# or VB. Tt does ''round trip'' > between the designer and persistant store, so it''s internally > consistent > - I think :) > > require ''mscorlib'' > require ''System'' > require ''System.Windows.Forms'' > require ''System.Drawing'' > > class Form1123 < System::Windows::Forms::Form > > attr_accessor :checkBox1 > attr_accessor :button2 > > def InitializeComponent > > self.button2 = System::Windows::Forms::Button.new() > self.checkBox1 = System::Windows::Forms::CheckBox.new() > self.SuspendLayout() > # > # button2 > # > self.button2.Location = System::Drawing::Point.new(79, 113) > self.button2.Name = "button2" > self.button2.Size = System::Drawing::Size.new(75, 23) > self.button2.TabIndex = 0 > self.button2.Text = "button2" > self.button2.TextAlign > System::Drawing::ContentAlignment.TopCenter > self.button2.UseVisualStyleBackColor = true > # > # checkBox1 > # > self.checkBox1.Anchor = System::Windows::Forms::AnchorStyles.Top | > System::Windows::Forms::AnchorStyles.Bottom | > System::Windows::Forms::AnchorStyles.Left > self.checkBox1.AutoSize = true > self.checkBox1.Location = System::Drawing::Point.new(79, 61) > self.checkBox1.Name = "checkBox1" > self.checkBox1.Size = System::Drawing::Size.new(90, 17) > self.checkBox1.TabIndex = 1 > self.checkBox1.Text = "checkBox1" > self.checkBox1.TextAlign > System::Drawing::ContentAlignment.TopLeft > self.checkBox1.UseVisualStyleBackColor = true > # > # Form1123 > # > self.ClientSize = System::Drawing::Size.new(284, 264) > self.Controls.Add(self.checkBox1) > self.Controls.Add(self.button2) > self.Name = "Form1123" > self.ResumeLayout(false) > self.PerformLayout() > end > end > > > good luck! > > Dermot > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core
I attached a patch that fixes inheriting from a CLR base class. Of course, there''s still a lot more work to do, but it lets you do the basic things like inherit from a CLR type and add methods in Ruby. - John M -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (DLR) Sent: Monday, October 08, 2007 3:08 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] trouble with super and .NET classes A quick look at the code: Enums are broken today, so that won''t work without some helper library that just returns the enum value. This is on our short list of bugs to fix already. Jomes has already fixed inheritance and will be posting a patch for that soon to unblock you (we''re still going to code review it internally and run it through our testing infrastructure before it gets out). Thanks, -John> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Dermot Hogan > Sent: Monday, October 08, 2007 2:56 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] trouble with super and .NET classes > > Hi John, > > Here''s some very simple text: a form, a checkbox and a button with a > couple of attributes. I haven''t been able run this in IR at all so I''ve > no idea if it will work or not. However, it looks like the sort of > thing > that the Form Designer produces in C# or VB. Tt does ''round trip'' > between the designer and persistant store, so it''s internally > consistent > - I think :) > > require ''mscorlib'' > require ''System'' > require ''System.Windows.Forms'' > require ''System.Drawing'' > > class Form1123 < System::Windows::Forms::Form > > attr_accessor :checkBox1 > attr_accessor :button2 > > def InitializeComponent > > self.button2 = System::Windows::Forms::Button.new() > self.checkBox1 = System::Windows::Forms::CheckBox.new() > self.SuspendLayout() > # > # button2 > # > self.button2.Location = System::Drawing::Point.new(79, 113) > self.button2.Name = "button2" > self.button2.Size = System::Drawing::Size.new(75, 23) > self.button2.TabIndex = 0 > self.button2.Text = "button2" > self.button2.TextAlign > System::Drawing::ContentAlignment.TopCenter > self.button2.UseVisualStyleBackColor = true > # > # checkBox1 > # > self.checkBox1.Anchor = System::Windows::Forms::AnchorStyles.Top | > System::Windows::Forms::AnchorStyles.Bottom | > System::Windows::Forms::AnchorStyles.Left > self.checkBox1.AutoSize = true > self.checkBox1.Location = System::Drawing::Point.new(79, 61) > self.checkBox1.Name = "checkBox1" > self.checkBox1.Size = System::Drawing::Size.new(90, 17) > self.checkBox1.TabIndex = 1 > self.checkBox1.Text = "checkBox1" > self.checkBox1.TextAlign > System::Drawing::ContentAlignment.TopLeft > self.checkBox1.UseVisualStyleBackColor = true > # > # Form1123 > # > self.ClientSize = System::Drawing::Size.new(284, 264) > self.Controls.Add(self.checkBox1) > self.Controls.Add(self.button2) > self.Name = "Form1123" > self.ResumeLayout(false) > self.PerformLayout() > end > end > > > good luck! > > Dermot > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: clrBaseType.patch Type: application/octet-stream Size: 2320 bytes Desc: clrBaseType.patch Url : http://rubyforge.org/pipermail/ironruby-core/attachments/20071008/9a35340d/attachment.obj
Charles Oliver Nutter
2007-Oct-08 22:55 UTC
[Ironruby-core] trouble with super and .NET classes
John Lam (DLR) wrote:>> Dermot Hogan: >> I haven''t tried the debugger yet. The basics should be reasonably easy, >> but I suspect the difficult bit will be getting the inspectors to work. >> I spent a lot of time with Matz''s Ruby getting VS debug expressions >> (the >> watch windows and debug data tips) to work correctly. The main problem >> is that there is no defined syntax for the string returned by inspect - >> you can return what you like - and there are at least 7 or 8 different >> formats. > > I wouldn''t recommend looking at this until we''ve had a chance to rewrite the scanner in IronRuby. Right now the one that we''re using doesn''t report line / column positions correctly. Once that works, we''ll be able to emit the correct PDBs, which should enable the VS debugger to "just work".Will there be any effort put into making existing Ruby debugging tools work, like debug.rb included in the Ruby stdlib and ruby-debug, the C-based extension that allows fast debugging through a similar interface? Most of the Java-based tools have based their debugging capabilities on debug.rb and ruby-debug, and soon will have a jruby-debug fast debugger to use. The JRuby compiler also enables the possibility of using a normal Java debugger, but being mixed-mode (both interpreted and compiled) complicates that somewhat. Is the current effort to only support PDB-style debugging? (FYI, you may want to look at the debug-commons project on RubyForge, it''s a community effort between some Eclipse guys and some NetBeans guys to build a common framework for debugging Ruby in those tools). - Charlie
Charlie Nutter wrote:> > Is the current effort to only support PDB-style debugging?Yes. We will look into adding additional debugging support once we understand the problem domain a bit better. If you take a look at debugging support in IronPython, you''ll get a feel for what''s possible here.> (FYI, you may want to look at the debug-commons project on RubyForge, > it''s a community effort between some Eclipse guys and some NetBeans > guys > to build a common framework for debugging Ruby in those tools).Thanks for the pointers. -John
thanks - that seems fine! Dermot -- Posted via http://www.ruby-forum.com/.
Is this going to be included in SVN anytime soon? -Eric On 10/8/07, John Messerly <jomes at microsoft.com> wrote:> > I attached a patch that fixes inheriting from a CLR base class. Of course, > there''s still a lot more work to do, but it lets you do the basic things > like inherit from a CLR type and add methods in Ruby. > > - John M > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (DLR) > Sent: Monday, October 08, 2007 3:08 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] trouble with super and .NET classes > > A quick look at the code: > > Enums are broken today, so that won''t work without some helper library > that just returns the enum value. This is on our short list of bugs to fix > already. > > Jomes has already fixed inheritance and will be posting a patch for that > soon to unblock you (we''re still going to code review it internally and run > it through our testing infrastructure before it gets out). > > Thanks, > -John > > > > -----Original Message----- > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > > bounces at rubyforge.org] On Behalf Of Dermot Hogan > > Sent: Monday, October 08, 2007 2:56 PM > > To: ironruby-core at rubyforge.org > > Subject: Re: [Ironruby-core] trouble with super and .NET classes > > > > Hi John, > > > > Here''s some very simple text: a form, a checkbox and a button with a > > couple of attributes. I haven''t been able run this in IR at all so I''ve > > no idea if it will work or not. However, it looks like the sort of > > thing > > that the Form Designer produces in C# or VB. Tt does ''round trip'' > > between the designer and persistant store, so it''s internally > > consistent > > - I think :) > > > > require ''mscorlib'' > > require ''System'' > > require ''System.Windows.Forms'' > > require ''System.Drawing'' > > > > class Form1123 < System::Windows::Forms::Form > > > > attr_accessor :checkBox1 > > attr_accessor :button2 > > > > def InitializeComponent > > > > self.button2 = System::Windows::Forms::Button.new() > > self.checkBox1 = System::Windows::Forms::CheckBox.new() > > self.SuspendLayout() > > # > > # button2 > > # > > self.button2.Location = System::Drawing::Point.new(79, 113) > > self.button2.Name = "button2" > > self.button2.Size = System::Drawing::Size.new(75, 23) > > self.button2.TabIndex = 0 > > self.button2.Text = "button2" > > self.button2.TextAlign > > System::Drawing::ContentAlignment.TopCenter > > self.button2.UseVisualStyleBackColor = true > > # > > # checkBox1 > > # > > self.checkBox1.Anchor = System::Windows::Forms::AnchorStyles.Top | > > System::Windows::Forms::AnchorStyles.Bottom | > > System::Windows::Forms::AnchorStyles.Left > > self.checkBox1.AutoSize = true > > self.checkBox1.Location = System::Drawing::Point.new(79, 61) > > self.checkBox1.Name = "checkBox1" > > self.checkBox1.Size = System::Drawing::Size.new(90, 17) > > self.checkBox1.TabIndex = 1 > > self.checkBox1.Text = "checkBox1" > > self.checkBox1.TextAlign > > System::Drawing::ContentAlignment.TopLeft > > self.checkBox1.UseVisualStyleBackColor = true > > # > > # Form1123 > > # > > self.ClientSize = System::Drawing::Size.new(284, 264) > > self.Controls.Add(self.checkBox1) > > self.Controls.Add(self.button2) > > self.Name = "Form1123" > > self.ResumeLayout(false) > > self.PerformLayout() > > end > > end > > > > > > good luck! > > > > Dermot > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > 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 > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20071017/5e5f6828/attachment.html