James Thompson
2009-Oct-16 20:14 UTC
[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 W: www.plainprograms.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20091016/d0e98fae/attachment-0001.html>
Tomas Matousek
2009-Oct-16 20:37 UTC
[Ironruby-core] Method parameter modifiers: out and ref
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>
Ivan Porto Carrero
2009-Oct-16 20:39 UTC
[Ironruby-core] Method parameter modifiers: out and ref
look here: http://rubyforge.org/pipermail/ironruby-core/2009-June/004731.html --- 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) On Fri, Oct 16, 2009 at 10:14 PM, James Thompson <james at plainprograms.com>wrote:> 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 > W: www.plainprograms.com > > _______________________________________________ > 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/20091016/30b8e6e1/attachment.html>