[Ironruby-core] Method parameter modifiers: out and ref

Tomas Matousek Tomas.Matousek at microsoft.com
Fri Oct 16 16:37:19 EDT 2009


They are just like out parameters that have input value as well.

public class C {
   public int foo(ref int bar) { bar++; return 3; }
}

p C.new.foo(1)  # => [3, 2]

Tomas


From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of James Thompson
Sent: Friday, October 16, 2009 1:14 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Method parameter modifiers: out and ref

I am trying to work with a .NET lib that uses ref modifiers on some method params and am not sure how to work with them from Ruby. I know with out modifiers that those parameters become part of the return values, but what can I do with ref parameters from Ruby?



James Thompson
Plain Programs
New Orleans, LA

P: (502) 619.0353
E: james at plainprograms.com<mailto:james at plainprograms.com>
W: www.plainprograms.com<http://www.plainprograms.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20091016/20e21253/attachment.html>


More information about the Ironruby-core mailing list