Hello, Just tried to do the following and got an odd error:>>> system::console::writeline("Test"):0: wrong number of arguments (1 for 2147483647) (ArgumentError) I do remember something similar a while ago - what why can''t it handle this? Thanks Ben
Jimmy Schementi
2009-Apr-27 07:14 UTC
[Ironruby-core] Console.Writeline - 2147483647 arguments?
Using proper casing will work:>>> System::Console.write_line("Test")Test => nil The casing you''re using yields:>>> system::console::writeline("Test"):0: wrong number of arguments (1 for 2147483647) (ArgumentError) Since "system" is Kernel#system. MRI yields a similar type of error also, so the error reporting isn''t at fault (though the (1 for 21...) message is a bit confusing: irb(main):002:0> system::console::writeline("Test") ArgumentError: wrong number of arguments from (irb):2:in `system'' from (irb):2> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Ben Hall > Sent: Sunday, April 26, 2009 10:19 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Console.Writeline - 2147483647 arguments? > > Hello, > > Just tried to do the following and got an odd error: > > >>> system::console::writeline("Test") > :0: wrong number of arguments (1 for 2147483647) (ArgumentError) > > I do remember something similar a while ago - what why can''t it handle > this? > > Thanks > > Ben > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core
Curt Hagenlocher
2009-Apr-27 13:22 UTC
[Ironruby-core] Console.Writeline - 2147483647 arguments?
And in case it''s not obvious, the CLR->Ruby casing/name-translation rules are 1) CLR namespaces and interfaces must be capitalized as they are mapped onto Ruby modules 2) CLR classes must be capitalized as they are mapped onto Ruby classes 3) CLR methods that you call may either retain their original spelling (ie "WriteLine") or they may be used in a more Rubyesque form which is obtained by translating CamelCase to lowercase_and_delimited (ie "write_line"). 4) CLR virtual methods which you override from IronRuby must be in their lowercase_and_delimited form. (Do we have a document that describes this?) -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: Monday, April 27, 2009 12:14 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Console.Writeline - 2147483647 arguments? Using proper casing will work:>>> System::Console.write_line("Test")Test => nil The casing you''re using yields:>>> system::console::writeline("Test"):0: wrong number of arguments (1 for 2147483647) (ArgumentError) Since "system" is Kernel#system. MRI yields a similar type of error also, so the error reporting isn''t at fault (though the (1 for 21...) message is a bit confusing: irb(main):002:0> system::console::writeline("Test") ArgumentError: wrong number of arguments from (irb):2:in `system'' from (irb):2> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Ben Hall > Sent: Sunday, April 26, 2009 10:19 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Console.Writeline - 2147483647 arguments? > > Hello, > > Just tried to do the following and got an odd error: > > >>> system::console::writeline("Test") > :0: wrong number of arguments (1 for 2147483647) (ArgumentError) > > I do remember something similar a while ago - what why can''t it handle > this? > > Thanks > > Ben > _______________________________________________ > 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
Jimmy Schementi
2009-Apr-27 18:53 UTC
[Ironruby-core] Console.Writeline - 2147483647 arguments?
Now we do =) http://ironruby.net/Documentation/CLR_Interop/Names Needs examples, links to the spec, etc.> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Curt Hagenlocher > Sent: Monday, April 27, 2009 6:22 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Console.Writeline - 2147483647 arguments? > > And in case it''s not obvious, the CLR->Ruby casing/name-translation > rules are > > 1) CLR namespaces and interfaces must be capitalized as they are mapped > onto Ruby modules > 2) CLR classes must be capitalized as they are mapped onto Ruby classes > 3) CLR methods that you call may either retain their original spelling > (ie "WriteLine") or they may be used in a more Rubyesque form which is > obtained by translating CamelCase to lowercase_and_delimited (ie > "write_line"). > 4) CLR virtual methods which you override from IronRuby must be in > their lowercase_and_delimited form. > > (Do we have a document that describes this?) > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Jimmy Schementi > Sent: Monday, April 27, 2009 12:14 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Console.Writeline - 2147483647 arguments? > > Using proper casing will work: > > >>> System::Console.write_line("Test") > Test > => nil > > The casing you''re using yields: > > >>> system::console::writeline("Test") > :0: wrong number of arguments (1 for 2147483647) (ArgumentError) > > Since "system" is Kernel#system. MRI yields a similar type of error > also, so the error reporting isn''t at fault (though the (1 for 21...) > message is a bit confusing: > > irb(main):002:0> system::console::writeline("Test") > ArgumentError: wrong number of arguments > from (irb):2:in `system'' > from (irb):2 > > > -----Original Message----- > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > > bounces at rubyforge.org] On Behalf Of Ben Hall > > Sent: Sunday, April 26, 2009 10:19 AM > > To: ironruby-core at rubyforge.org > > Subject: [Ironruby-core] Console.Writeline - 2147483647 arguments? > > > > Hello, > > > > Just tried to do the following and got an odd error: > > > > >>> system::console::writeline("Test") > > :0: wrong number of arguments (1 for 2147483647) (ArgumentError) > > > > I do remember something similar a while ago - what why can''t it > handle > > this? > > > > Thanks > > > > Ben > > _______________________________________________ > > 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