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
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
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
And in case it’s not obvious, the CLR->Ruby casing/name-translation
rules are
(Do we have a document that describes this?)
Now we do =)
http://ironruby.net/Documentation/CLR_Interop/Names
Needs examples, links to the spec, etc.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs