[Ironruby-core] performance wise we're doing good

2009-08-03 Thread Ivan Porto Carrero
http://antoniocangiano.com/2009/08/03/performance-of-ironruby-ruby-on-windows/ --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) ___

[Ironruby-core] Getting a delegate in IronRuby

2009-08-03 Thread Martin Smith
Hello, I was wondering how I can get a delegate in IronRuby. One thing I was thinking about doing was trying to attach an event handler with an EventInfo and it requires a delegate. It has a method called AddEventHandler(object, Delegate), and i wanted to attach an event handler. But I can't fi

Re: [Ironruby-core] Getting a delegate in IronRuby

2009-08-03 Thread Jim Deville
For and event, you can use a block: l = lambda {|s,e| do.stuff.here } foo.event_name.add &l foo.event_name.remove &l Thanks, JD ...there is no try http://blog.jredville.com From: ironruby-core-boun...@rubyforge.org [mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Martin Smith Sent: M

[Ironruby-core] Code Review: NewStruct2

2009-08-03 Thread Tomas Matousek
tfpt review "/shelveset:NewStruct2;REDMOND\tomat" DLR interpreter: Fixes instantiation of Struct w/o constructor. Tomas NewStruct2.diff Description: NewStruct2.diff ___ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.o

[Ironruby-core] CLR String: can't convert Range into Fixnum (Bug?)

2009-08-03 Thread Martin Smith
Hello, I'm wondering if I've run into a bug. I have an XmlReader and the Name property returns a string (a clr string). This becomes an issue when i do something like: reader.name[5..10] This causes a can't convert Range into Fixnum error. Is this the expected behavior? This works fine: rea

Re: [Ironruby-core] Quick IronRuby question

2009-08-03 Thread Jimmy Schementi
Rob, (Adding the IronRuby Mailing List so everyone has context) You need to "require 'rubygems'" first before using any installed gems. That being said, IronRuby will not be able to use any native gems built for Ruby 1.8.6 (like RMagick), since they are specifically built for Ruby's C API, and I

Re: [Ironruby-core] Getting a delegate in IronRuby

2009-08-03 Thread Martin Smith
Thanks Jim, I'm more trying to understand the underlying type semantics with delegates. How would I do something like this: >>> a = System::Array[System::Delegate].new(5) => [nil, nil, nil, nil, nil] >>> a[0] = lambda {|x| puts x } mscorlib:0:in `InternalSetValue': Object cannot be stored in an

Re: [Ironruby-core] CLR String: can't convert Range into Fixnum (Bug?)

2009-08-03 Thread Tomas Matousek
This is a bug. I've filed it here http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=1927 Tomas From: ironruby-core-boun...@rubyforge.org [mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Martin Smith Sent: Monday, August 03, 2009 4:26 PM To: ironruby-core@rubyforge.org Subject:

Re: [Ironruby-core] Getting a delegate in IronRuby

2009-08-03 Thread Tomas Matousek
You need to specify the type of the delegate in order to implicitly convert a Ruby lambda to it. System.Delegate is not specific enough. You need to use some subclass of Delegate. So you can e.g. change the type of the array: load_assembly 'System.Core' a = System::Array[System::Action.of(Objec

Re: [Ironruby-core] Getting a delegate in IronRuby

2009-08-03 Thread Ray Vernagus
** I tried sending this much earlier but my message didn't go through ** Hi, Martin-- Here's a short example that might illustrate what you're trying to accomplish: require "System.Windows.Forms" include System include System::Windows::Forms button = Button.new click_event = button.GetType.get

[Ironruby-core] Code Review: VirtualEvents

2009-08-03 Thread Tomas Matousek
tfpt review "/shelveset:VirtualEvents;REDMOND\tomat" Enables overriding of events. Given a class like: public class C { public virtual event Func OnEvent; } you can implement a Ruby subclass D that overrides the event like so: class D < C def add_OnEvent handler puts

Re: [Ironruby-core] More WCF fail

2009-08-03 Thread Ray Vernagus
Re: WCF services with IronRuby WCF programmers interested in IronRuby might like to check out an example of using WCF in IronRuby that I have created: wcf_service.rb A few caveats are

[Ironruby-core] Code Review: rake context

2009-08-03 Thread Ryan Riley
Patch for context.rb: This should allow those who build with "rake compile" to install gems successfully using igem. Changes the context.rb (line 370) :LibraryPaths from "..\External.LCA_RESTRICTED\Languages\Ruby\ruby-1.8.6p287\.." to "..\External.LCA_RESTRICTED\Languages\Ruby\redist-libs\.." htt

Re: [Ironruby-core] Code Review: rake context

2009-08-03 Thread Jim Deville
Looks good. I’ll pull it in with the next pull. JD …there is no try http://blog.jredville.com From: ironruby-core-boun...@rubyforge.org [mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Ryan Riley Sent: Monday, August 03, 2009 9:39 PM To: ironruby-core@rubyforge.org Subject: [Ironruby-c