Code Review: StringIO and Array.to_s

Tim, this bounced … are you registered for the mailing list?
http://rubyforge.org/mailman/listinfo/ironruby-core

From: Tim C. (SDO) [mailto:[email protected]]
Sent: Monday, June 15, 2009 4:23 PM
To: [email protected]
Subject: Code Review: StringIO and Array.to_s

Modified RecursiveJoin to have an printRecursiveArray option.
This is needed since StringIO does not print out recursiveArray values
while array.to_s does.

For example:

a = [1,2,3]
a << a
@io.puts(a) → prints "1\n2\n3\n[…]\n
a.to_s → prints “123123[…]”

Fixed all calls to Join to also pass in printRecursiveArray option.

Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/IoOps.cshttp://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033#diff-0
*
Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/IListOps.cshttp://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033#diff-1

http://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033

Thanks!

Tim

Yes I am,

I just emailed to the wrong email address!

(ironruby-core-bounces instead of ironruby-core)

It was autocompleted by outlook, and I didn’t know which is right.

Thanks!

Tim

From: [email protected]
[mailto:[email protected]] On Behalf Of Jimmy
Schementi
Sent: Monday, June 15, 2009 4:27 PM
To: [email protected]
Subject: [Ironruby-core] Code Review: StringIO and Array.to_s

Tim, this bounced … are you registered for the mailing list?
http://rubyforge.org/mailman/listinfo/ironruby-core

From: Tim C. (SDO) [mailto:[email protected]]
Sent: Monday, June 15, 2009 4:23 PM
To: [email protected]
Subject: Code Review: StringIO and Array.to_s

Modified RecursiveJoin to have an printRecursiveArray option.
This is needed since StringIO does not print out recursiveArray values
while array.to_s does.

For example:

a = [1,2,3]
a << a
@io.puts(a) → prints "1\n2\n3\n[…]\n
a.to_s → prints “123123[…]”

Fixed all calls to Join to also pass in printRecursiveArray option.

Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/IoOps.cshttp://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033#diff-0
*
Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/IListOps.cshttp://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033#diff-1

http://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033

Thanks!

Tim

With IR 0.3 release we have:

c:\work\napa.net\NapaRuby>\work\tools\ruby\ironruby-0.3.0\bin\ir.exe
IronRuby 0.3.0.0 on .NET 2.0.50727.3074
Copyright (c) Microsoft Corporation. All rights reserved.

x=“abc”.to_clr_string
=> ‘abc’

We can call x.GetType method in “ruby case”:

x.get_type
=> #System::RuntimeType:0x000005c

With a recent codebase from:
http://www.codeplex.com/dlr/SourceControl/ListDownloadableCommits.aspx
ChangeSet 25140

c:\work\napa.net\NapaRuby>ir
IronRuby 0.5.0.0 on .NET 2.0.50727.3074
Copyright (c) Microsoft Corporation. All rights reserved.

x=System::String.new(‘abc’)
=> ‘abc’

x.get_type
:0:in __send__': undefined method get_type’ for “abc”:String
(NoMethodError)

from C:.…\IronRuby.Libraries\Builtins\KernelOps.cs:1421:in
`SendMessageOpt’

We can still use the original method name:

x.GetType
=> System.String

I suppose the apparent dropping of support for name-mungling is not
intentional?

Robert J. Brotherus
Napa Inc.

Hi Tim, are there existing RubySpecs for the bug? If so, please enable
the tests by deleting the tags. Else, could you please add to the
RubySpec specs?

From: [email protected]
[mailto:[email protected]] On Behalf Of Tim C. (SDO)
Sent: Tuesday, June 16, 2009 12:01 AM
To: [email protected]
Subject: Re: [Ironruby-core] Code Review: StringIO and Array.to_s

Yes I am,

I just emailed to the wrong email address!

(ironruby-core-bounces instead of ironruby-core)

It was autocompleted by outlook, and I didn’t know which is right.

Thanks!

Tim

From: [email protected]
[mailto:[email protected]] On Behalf Of Jimmy
Schementi
Sent: Monday, June 15, 2009 4:27 PM
To: [email protected]
Subject: [Ironruby-core] Code Review: StringIO and Array.to_s

Tim, this bounced … are you registered for the mailing list?
http://rubyforge.org/mailman/listinfo/ironruby-core

From: Tim C. (SDO) [mailto:[email protected]]
Sent: Monday, June 15, 2009 4:23 PM
To: [email protected]
Subject: Code Review: StringIO and Array.to_s

Modified RecursiveJoin to have an printRecursiveArray option.
This is needed since StringIO does not print out recursiveArray values
while array.to_s does.

For example:

a = [1,2,3]
a << a
@io.puts(a) → prints "1\n2\n3\n[…]\n
a.to_s → prints “123123[…]”

Fixed all calls to Join to also pass in printRecursiveArray option.

Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/IoOps.cshttp://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033#diff-0
*
Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/IListOps.cshttp://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033#diff-1

http://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033

Thanks!

Tim

It is in fact intentional - mangled names are disabled for built-in
types (Object, Fixnum, String, etc.) since there were problems with name
conflicts in various Ruby apps.
The mangling is still on for other CLR types.

Tomas

I believe he already enabled the spec for Array, and the one for
StringIO was running before this fix, so there are no tags or tests
needed.

JD

…there is no try

From: [email protected]
[mailto:[email protected]] On Behalf Of Shri B.
Sent: Tuesday, June 16, 2009 3:19 PM
To: [email protected]
Subject: Re: [Ironruby-core] Code Review: StringIO and Array.to_s

Hi Tim, are there existing RubySpecs for the bug? If so, please enable
the tests by deleting the tags. Else, could you please add to the
RubySpec specs?

From: [email protected]
[mailto:[email protected]] On Behalf Of Tim C. (SDO)
Sent: Tuesday, June 16, 2009 12:01 AM
To: [email protected]
Subject: Re: [Ironruby-core] Code Review: StringIO and Array.to_s

Yes I am,

I just emailed to the wrong email address!

(ironruby-core-bounces instead of ironruby-core)

It was autocompleted by outlook, and I didn’t know which is right.

Thanks!

Tim

From: [email protected]
[mailto:[email protected]] On Behalf Of Jimmy
Schementi
Sent: Monday, June 15, 2009 4:27 PM
To: [email protected]
Subject: [Ironruby-core] Code Review: StringIO and Array.to_s

Tim, this bounced … are you registered for the mailing list?
http://rubyforge.org/mailman/listinfo/ironruby-core

From: Tim C. (SDO) [mailto:[email protected]]
Sent: Monday, June 15, 2009 4:23 PM
To: [email protected]
Subject: Code Review: StringIO and Array.to_s

Modified RecursiveJoin to have an printRecursiveArray option.
This is needed since StringIO does not print out recursiveArray values
while array.to_s does.

For example:

a = [1,2,3]
a << a
@io.puts(a) → prints "1\n2\n3\n[…]\n
a.to_s → prints “123123[…]”

Fixed all calls to Join to also pass in printRecursiveArray option.

Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/IoOps.cshttp://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033#diff-0
*
Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/IListOps.cshttp://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033#diff-1

http://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033

Thanks!

Tim

Code changes look good.

From: [email protected]
[mailto:[email protected]] On Behalf Of Jim D.
Sent: Tuesday, June 16, 2009 3:42 PM
To: [email protected]
Subject: Re: [Ironruby-core] Code Review: StringIO and Array.to_s

I believe he already enabled the spec for Array, and the one for
StringIO was running before this fix, so there are no tags or tests
needed.

JD

…there is no try

From: [email protected]
[mailto:[email protected]] On Behalf Of Shri B.
Sent: Tuesday, June 16, 2009 3:19 PM
To: [email protected]
Subject: Re: [Ironruby-core] Code Review: StringIO and Array.to_s

Hi Tim, are there existing RubySpecs for the bug? If so, please enable
the tests by deleting the tags. Else, could you please add to the
RubySpec specs?

From: [email protected]
[mailto:[email protected]] On Behalf Of Tim C. (SDO)
Sent: Tuesday, June 16, 2009 12:01 AM
To: [email protected]
Subject: Re: [Ironruby-core] Code Review: StringIO and Array.to_s

Yes I am,

I just emailed to the wrong email address!

(ironruby-core-bounces instead of ironruby-core)

It was autocompleted by outlook, and I didn’t know which is right.

Thanks!

Tim

From: [email protected]
[mailto:[email protected]] On Behalf Of Jimmy
Schementi
Sent: Monday, June 15, 2009 4:27 PM
To: [email protected]
Subject: [Ironruby-core] Code Review: StringIO and Array.to_s

Tim, this bounced … are you registered for the mailing list?
http://rubyforge.org/mailman/listinfo/ironruby-core

From: Tim C. (SDO) [mailto:[email protected]]
Sent: Monday, June 15, 2009 4:23 PM
To: [email protected]
Subject: Code Review: StringIO and Array.to_s

Modified RecursiveJoin to have an printRecursiveArray option.
This is needed since StringIO does not print out recursiveArray values
while array.to_s does.

For example:

a = [1,2,3]
a << a
@io.puts(a) → prints "1\n2\n3\n[…]\n
a.to_s → prints “123123[…]”

Fixed all calls to Join to also pass in printRecursiveArray option.

Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/IoOps.cshttp://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033#diff-0
*
Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/IListOps.cshttp://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033#diff-1

http://github.com/tnachen/ironruby/commit/759f6007467a0655b2d707f71de1cd5518b65033

Thanks!

Tim