Ok.

Here is a small patch for the RubyHash-part of things. Since there
doesn't seem to be a test case for RubyArray I will get one started. The
tests in this patch uncover a slight problem: when calling
RubyHash#entrySet, and then Iterator, we get a ClassCastException in
ConversionIterator, since it tries to cast an Map.Entry to IRubyObject.
This is deeper, since other places uses the entrySet. How should we
solve this?

Regards
 Ola Bini

----- Original Message -----
From: Ola Bini <[EMAIL PROTECTED]>
Date: Thursday, March 23, 2006 9:11 pm
Subject: Re: [Jruby-devel] newArray-implementations.
To: [email protected]

> Hi.
> 
> Ah, of course. Well, then it does make sense, and I will change the
> tests and implementation to reflect this. Good! =)
> 
> /O
> 
> ----- Original Message -----
> From: Thomas E Enebo <[EMAIL PROTECTED]>
> Date: Thursday, March 23, 2006 9:07 pm
> Subject: Re: [Jruby-devel] newArray-implementations.
> To: [email protected]
> 
> >  Oh!  Array and Hash are meant to implement List and Map so that 
> > userscan pass Ruby arrays/hashes out to Java space and get back 
> > sensible Java 
> > instances without performing a copy of the entire Array/Hash 
> > structure to 
> > its Java counterpart.  The toArray(Object[] m) method is doing 
> the 
> > right 
> > thing since it is exposing the fixnum as a Long if accessed from 
> a 
> > Java 
> > consumer.
> > 
> >  Did this make sense?  Did I miss something?
> > 
> > -Tom
> > 
> > On Thu, 23 Mar 2006, Ola Bini defenestrated me:
> > > Hi!
> > > 
> > > Ok, I've got the tests working, and written a little testing for
> > > RubyHash, but it seems my intuition serves me wrong.
> > > I get hold of a RubyHash created with something like 
> {1=>2,3=>4} and
> > > call keySet on it. The keySet I get back contains object of 
> type 
> > Long,> and not RubyFixnum as I expected. Is this the way it 
> should 
> > be? (And if
> > > it is, then implementing toArray(Object[]) is really not 
> necessary,> > since any call to it will cause it to explode).
> > > 
> > > Regards
> > >  Ola Bini
> > > 
> > > ----- Original Message -----
> > > From: Thomas E Enebo <[EMAIL PROTECTED]>
> > > Date: Thursday, March 23, 2006 4:28 pm
> > > Subject: Re: [Jruby-devel] newArray-implementations.
> > > To: [email protected]
> > > 
> > > >  For those tests we have some junit tests in test/org...
> > > > 
> > > >  Some specifically related to testing Array and Hash.  I am 
> off to
> > > > a meeting right now so the specifics are not at hand...
> > > > 
> > > >  If you add to that test then they will get run at part of 
> ant 
> > test.> > Along the lines of testing you will notice I added 
> > test/testZlib.rb 
> > > > forunit tests for that package.
> > > > 
> > > > -Tom
> > > > 
> > > > On Thu, 23 Mar 2006, Ola Bini defenestrated me:
> > > > >
> > > > > Haha, yes, I was thinking about that.
> > > > > On the subject, is there any standard for coding unit-
> tests, 
> > > > where to
> > > > > put them etc?
> > > > > Is there a goal in ant for running the tests?
> > > > > 
> > > > > /O
> > > > > 
> > > > > > On Wed, 22 Mar 2006, Ola Bini defenestrated me:
> > > > > > > 
> > > > > > > Here comes a small patch, with implementations for 
> Object[]> > > > > > toArray(Object[]) in RubyArray and RubyHash.
> > > > > > 
> > > > > > Cool.
> > > > > > 
> > > > > > Applied (with minor changes under guise of consistency 
> with 
> > > > rest of
> > > > > > code base).  Bonus points if you provide an additional patch
> > > > > > with some unit tests for it :)
> > > > > > 
> > > > > > -Tom
> > > > > > 
> > > > > > 
> > > > > > -- 
> > > > > > + http://www.tc.umn.edu/~enebo +---- mailto:[EMAIL PROTECTED] 
> --
> > --+
> > > > > > | Thomas E Enebo, Protagonist  | "Luck favors the 
> prepared  
> >  |
> > > > > > |                              |  mind." -Louis Pasteur   
>  
> >  |
> > > > > > 
> > > > > > 
> > > > > > -------------------------------------------------------
> > > > > > This SF.Net email is sponsored by xPML, a groundbreaking 
> > > > scripting 
> > > > > > languagethat extends applications into web and mobile 
> > media. 
> > > > Attend 
> > > > > > the live webcast
> > > > > > and join the prime developer group breaking into this new 
> > > > coding 
> > > > > > territory!http://sel.as-
> > > > > >
> > > > > 
> > > >
> > > 
> >
>
us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642_______________________________________________>>
> > Jruby-devel mailing list
> > > > > > [email protected]
> > > > > > https://lists.sourceforge.net/lists/listinfo/jruby-devel
> > > > > > 
> > > > > 
> > > > > 
> > > > > -------------------------------------------------------
> > > > > This SF.Net email is sponsored by xPML, a groundbreaking 
> > > > scripting language
> > > > > that extends applications into web and mobile media. Attend 
> > the 
> > > > live webcast
> > > > > and join the prime developer group breaking into this new 
> > coding 
> > > > territory!> http://sel.as-
> > > > us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642> 
> > > > _______________________________________________> Jruby-devel 
> > > > mailing list
> > > > > [email protected]
> > > > > https://lists.sourceforge.net/lists/listinfo/jruby-devel
> > > > 
> > > > -- 
> > > > + http://www.tc.umn.edu/~enebo +---- mailto:[EMAIL PROTECTED] ----+
> > > > | Thomas E Enebo, Protagonist  | "Luck favors the prepared    |
> > > > |                              |  mind." -Louis Pasteur       |
> > > > 
> > > > 
> > > > -------------------------------------------------------
> > > > This SF.Net email is sponsored by xPML, a groundbreaking 
> > scripting 
> > > > languagethat extends applications into web and mobile media. 
> > Attend 
> > > > the live webcast
> > > > and join the prime developer group breaking into this new 
> > coding 
> > > > territory!http://sel.as-
> > > >
> > > 
> >
>
us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642_______________________________________________>
> > Jruby-devel mailing list
> > > > [email protected]
> > > > https://lists.sourceforge.net/lists/listinfo/jruby-devel
> > > > 
> > > 
> > > 
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by xPML, a groundbreaking 
> > scripting language
> > > that extends applications into web and mobile media. Attend the 
> > live webcast
> > > and join the prime developer group breaking into this new 
> coding 
> > territory!> http://sel.as-
> > us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642> 
> > _______________________________________________> Jruby-devel 
> > mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/jruby-devel
> > 
> > -- 
> > + http://www.tc.umn.edu/~enebo +---- mailto:[EMAIL PROTECTED] ----+
> > | Thomas E Enebo, Protagonist  | "Luck favors the prepared    |
> > |                              |  mind." -Louis Pasteur       |
> > 
> > 
> > -------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a groundbreaking 
> scripting 
> > languagethat extends applications into web and mobile media. 
> Attend 
> > the live webcast
> > and join the prime developer group breaking into this new coding 
> > territory!http://sel.as-
> >
>
us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642_______________________________________________
> > Jruby-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/jruby-devel
> > 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting 
> languagethat extends applications into web and mobile media. Attend 
> the live webcast
> and join the prime developer group breaking into this new coding 
> territory!http://sel.as-
>
us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642_______________________________________________
> Jruby-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jruby-devel
> 

Attachment: toArray.patch
Description: Binary data

Reply via email to