[Ironruby-core] something has changed

Curt Hagenlocher curth at microsoft.com
Sat Jun 6 11:15:36 EDT 2009


It would be good to be more specific about the example.

Consider class Foo {
    public void Bar(int, object);
    public void Bar(int, string);
}

If I call "Foo.new.Bar 1, nil", then this is an ambiguous call and you should be forced to specify which overload you want.

In statically-typed languages, variables have types and the declared type of the variable is used to select an overload at compile time. This obviously doesn't work for a dynamically-typed language calling into a statically-typed API, so we have to use the runtime types to select the overload. C# dynamic calls face the same issue.

From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero
Sent: Saturday, June 06, 2009 8:05 AM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] something has changed

In C# you can pass null to a string parameter and it won't complain I expected this to work from ironruby too because it did before. So I want to find out if that is going to be a permanent change or if it is a bug :)
so i'm not talking about an empty instance of String being nil  but it's about interop with CLR stuff
---
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 Sat, Jun 6, 2009 at 4:52 PM, Will Green <will at hotgazpacho.org<mailto:will at hotgazpacho.org>> wrote:
Just curious, but why should nil count as a string object? In C Ruby, nil is an object, and an empty string object is not nil:

irb(main):001:0> n = nil
=> nil
irb(main):002:0> s = String.new
=> ""
irb(main):003:0> n.nil?
=> true
irb(main):004:0> s.nil?
=> false
irb(main):005:0> s == n
=> false
irb(main):006:0> n.class
=> NilClass
irb(main):007:0> s.class
=> String
irb(main):008:0> s.eql? n
=> false

--
Will Green
http://willgreen.mp/

On Sat, Jun 6, 2009 at 9:23 AM, Ivan Porto Carrero <ivan at flanders.co.nz<mailto:ivan at flanders.co.nz>> wrote:
Hi

Since this weeks updates to ironruby ironrubymvc is completely broken.

The way overloads are selected now is different.

for example asp.net<http://asp.net> mvc has a bunch of methods defined on Controller that are protected internal ie. protected internal void View(string, string)
it also has an overload View(string, object)

Then it selects the one with object for example in some cases

also I used to be able to call that view method in a ruby subclass of Controller with view nil, 'layout'

but now I have to call that with with view '','layout' for it to work for example. It  doesn't know that nil can also count as a string object.

There are a bunch of other things that are breaking for example it doesn't like protected internals as much as it used to anymore either.

codeplex?

---
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)

_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org>
http://rubyforge.org/mailman/listinfo/ironruby-core


_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org<mailto: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/20090606/84dcdf59/attachment.html>


More information about the Ironruby-core mailing list