Re: [jruby-dev] A real Java integration enhancement need: null casting

2009-08-10 Thread Thomas E Enebo
On Mon, Aug 10, 2009 at 11:10 AM, Logan Barnett wrote: > Is the problem here that you can't cast to null with the correct type, or > you just can't invoke the correct override? I'm thinking it's override > selection. > > All of the null casting suggestions seem great if you know that you have > nil

Re: [jruby-dev] A real Java integration enhancement need: null casting

2009-08-10 Thread Logan Barnett
Is the problem here that you can't cast to null with the correct type, or you just can't invoke the correct override? I'm thinking it's override selection. All of the null casting suggestions seem great if you know that you have nil, but typically we have a variable which may or may not be

Re: [jruby-dev] A real Java integration enhancement need: null casting

2009-08-07 Thread Charles Oliver Nutter
On Fri, Aug 7, 2009 at 3:35 AM, Ola Bini wrote: > Jimmy Schementi wrote: >> >> How about adding NilClass#as(class)? This is much less likely to cause >> name collisions. We have the same issue with IronRuby, and this is the >> solution we are favoring currently. >> >> obj.doSomething(nil.as

Re: [jruby-dev] A real Java integration enhancement need: null casting

2009-08-07 Thread Ola Bini
Jimmy Schementi wrote: How about adding NilClass#as(class)? This is much less likely to cause name collisions. We have the same issue with IronRuby, and this is the solution we are favoring currently. obj.doSomething(nil.as (Component), 0) ~Jimmy I'm still trying to think about

Re: [jruby-dev] A real Java integration enhancement need: null casting

2009-08-06 Thread Jimmy Schementi
How about adding NilClass#as(class)? This is much less likely to cause name collisions. We have the same issue with IronRuby, and this is the solution we are favoring currently. obj.doSomething(nil.as(Component), 0) ~Jimmy On Thu, Aug 6, 2009 at 9:33 AM, Martin McNulty wrote: > HashMap.null >

Re: [jruby-dev] A real Java integration enhancement need: null casting

2009-08-06 Thread Martin McNulty
HashMap.null Doesn't use 'nil', but then I guess it is a Java null you're passing into the method... Handily can't conflict with a Java field name. I have almost no idea of how this would be implemented though, so perhaps this suggestion's a really bad one ;) Martin 2009/8/6 Thomas E Enebo : >

Re: [jruby-dev] A real Java integration enhancement need: null casting

2009-08-06 Thread Thomas E Enebo
nil.to_java(HashMap) -Tom On Thu, Aug 6, 2009 at 1:50 AM, Charles Oliver Nutter wrote: > This is an important one: > > http://jira.codehaus.org/browse/JRUBY-3865 > > It's definitely not a hypothetical situation, and I have had this come > up a few times myself. Perhaps we can have some discussion

[jruby-dev] A real Java integration enhancement need: null casting

2009-08-05 Thread Charles Oliver Nutter
This is an important one: http://jira.codehaus.org/browse/JRUBY-3865 It's definitely not a hypothetical situation, and I have had this come up a few times myself. Perhaps we can have some discussion here or on the bug about what our casting syntax should look like? - Charlie ---