[Ironruby-core] Code review: String#unpack, Bignum and Array related stuff
Shri.Borde at microsoft.com
Wed Jul 22 17:51:47 EDT 2009
Looks good. In Array#zip, you prefer casting to IList, and use Protocols.TryCastToArray as a fallback. Is that correct? If an IList object defines to_a, shouldn't to_a get called?
The array argument to Array#zip is marked as [NotNull]. Should it also be marked as [NotNullItems]?
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri
Sent: Wednesday, July 22, 2009 1:51 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Code review: String#unpack, Bignum and Array related stuff
Just a quick note: updated with
On Sun, Jul 19, 2009 at 11:29, Daniele Alessandri<suppakilla at gmail.com> wrote:
> first of all I am trying a different approach to submitting my
> patches: I created a code_review branch on my repository in which I am
> going to push all my fixes for review. Fixes that will pass review
> will be rebased (not merged) in my main branch (ready to get pulled
> into the ironruby repository), the others will remain staged in my
> code_review branch for further works until they are "approved". I am
> just experimenting a different git workflow :-)
> Anyway, let's move on to the new commits:
> * http://github.com/nrk/ironruby/commit/48a4a02b5b47d61f2f7a3f3887ea4bf02d63edb4
> - More fixes for String#unpack:
> o Fixed errors when unpacking data with 'Z' and '@' directives
> o Implemented 'Q' and 'q' directives
> * http://github.com/nrk/ironruby/commit/17b5edab64967b0200370edf6657321a0f79953d
> - Array related fixes:
> o Array#== does not call #to_ary on its argument but it calls #to_a (it
> basically performs a conversion of the argument rather than casting it to a
> ruby array)
> o Array#zip calls #to_ary to cast the argument to an Array, therefore it
> overrides Enumerable#zip in which the argument is converted by calling
> * http://github.com/nrk/ironruby/commit/547d810c78b38afc34e728855ab7d0c20f499719
> - Bignum related fixes:
> o Changed the signature for ClrBigInteger.ToString(self,radix), now
> Bignum#to_s works as expected raising an ArgumentException if base is less
> than 2 or higher than 36.
> o Fixed Bignum#divmod, Bignum#remainder, Bignum#% and Bignum#modulo to work
> with Float values as argument.
> o Fixed Bignum#/ and Bignum#div as they behave differently with each other
> when Float values are passed as argument.
> Note: Now bignum does not fail any of the expectations in core/bignum.
> See also the attached diff.
Ironruby-core mailing list
Ironruby-core at rubyforge.org
More information about the Ironruby-core