Re: [Ironruby-core] accessor methods and property syntax in .NET

2010-09-09 Thread Ted Neward
o:ironruby-core-boun...@rubyforge.org] On Behalf Of Shay Friedman Sent: Tuesday, September 07, 2010 5:57 AM To: ironruby-core@rubyforge.org Subject: Re: [Ironruby-core] accessor methods and property syntax in .NET Beware! Contributing to the IronRuby source code might result in having babies!!!

Re: [Ironruby-core] accessor methods and property syntax in .NET

2010-09-07 Thread Shay Friedman
Beware! Contributing to the IronRuby source code might result in having babies!!! :-) Congratulations Brian! On Tue, Sep 7, 2010 at 3:47 PM, Brian Genisio wrote: > Actually, we discussed this about a month ago: > http://rubyforge.org/pipermail/ironruby-core/2010-July/007154.html > >

Re: [Ironruby-core] accessor methods and property syntax in .NET

2010-09-07 Thread Davy Brion
Hey Brian, i saw that thread, but didn't really see a definitive answer as to how to work around it until it's implemented (though i might've missed it), which is why i thought i'd raise the question again :) On Tue, Sep 7, 2010 at 2:47 PM, Brian Genisio wrote: > Actually, we discussed this abou

Re: [Ironruby-core] accessor methods and property syntax in .NET

2010-09-07 Thread Brian Genisio
Actually, we discussed this about a month ago: http://rubyforge.org/pipermail/ironruby-core/2010-July/007154.html The outcome was that a feature request was added to allow for C# properties to be defined using getter/setter in rub

Re: [Ironruby-core] accessor methods and property syntax in .NET

2010-09-07 Thread Davy Brion
your solution does however work for the assignment accessor... in fact, you can do something like this: class Foo attr_reader :bar def bar=(val) # do more stuff here for example @bar = val end end and then you can do the following in C#: var value = myObject.bar; myObject.bar = s

Re: [Ironruby-core] accessor methods and property syntax in .NET

2010-09-07 Thread Davy Brion
if i do that, calling bar as a property like this: var value = myObject.bar; leads to 'value' being an instance of IronRuby.BuiltIns.RubyMethod, and not the value that is in the @bar instance field which i'm using 1.1 btw, not sure how this would behave on 1.0 from looking at the IronRuby sour

Re: [Ironruby-core] accessor methods and property syntax in .NET

2010-09-07 Thread Ivan Porto Carerro
You can just define them as attr_accessors and then implement the methods class Foo attr_accessor :bar, :baz def bar=(val) # do more stuff here for example @bar = val end def bar @bar end end On Tue, Sep 7, 2010 at 10:36 AM, Davy Brion wrote: > Hi all, > > IronRuby has