Re: [Ironruby-core] Code Review: MutableString5

2008-05-11 Thread Tomas Matousek
I thought about that, but given that there are like 15 overloads for Append it might be an unnecessary code duplication to add them for constructors as well. You can do it on a single line too: MutableString str = MutableString.CreateBinary(received).Append(buffer, 0, received); Append returns

Re: [Ironruby-core] RubyForge bug fixes

2008-05-11 Thread Unnikrishnan Nair
Hi Peter, Fantastic point, now that I am understanding the code, it makes perfect sense, I really appriciate the comments. Thanks. - Original Message From: Peter Bacon Darwin <[EMAIL PROTECTED]> To: ironruby-core@rubyforge.org Sent: Sunday, May 11, 2008 7:14:48 AM Subject: Re: [Ironruby

Re: [Ironruby-core] (no subject)

2008-05-11 Thread Curt Hagenlocher
1. ConvertToString is much more readable. 2. The JITter could theoretically eliminate one or more method calls anyway (though I can't say that I know for sure that it does). 3. We haven't done anything to optimize this new version of MutableString yet. In particular, we might find that getting a

Re: [Ironruby-core] running tests on server 2008

2008-05-11 Thread Peter Bacon Darwin
The chdir_spec warnings are to do with block-less calls to chdir within a block attached to another call to chdir. The following code does not raise a warning... irb(main):001:0> Dir.chdir("c:\\Windows") do irb(main):002:1* puts Dir.pwd irb(main):003:1> Dir.chdir("System32") do irb

Re: [Ironruby-core] (no subject)

2008-05-11 Thread Peter Bacon Darwin
Magic! Now the next question is should I be using: mutableString.ConvertToString() or mutableString.GetStringSlice(0) to get hold of a CLR string for passing to a .NET method. Both end up calling Content.GetStringSlice(...) anyway but the second one seems to go through slightly fewer meth

Re: [Ironruby-core] (no subject)

2008-05-11 Thread Curt Hagenlocher
MutableString.ToSymbol()? On Sun, May 11, 2008 at 5:34 AM, Peter Bacon Darwin < [EMAIL PROTECTED]> wrote: > It would be useful to have a helper function to clean up this kind of > code. Or is there one and I can't find it? > > > > RubyUtils.GetConstant(context, rubyClass, > SymbolTable.StringT

[Ironruby-core] (no subject)

2008-05-11 Thread Peter Bacon Darwin
It would be useful to have a helper function to clean up this kind of code. Or is there one and I can't find it? RubyUtils.GetConstant(context, rubyClass, SymbolTable.StringToId(mutableString.ConvertToString()), true); ___ Ironruby-core mailing

Re: [Ironruby-core] Code Review: MutableString5

2008-05-11 Thread Peter Bacon Darwin
One thing that MutableString could do with is public static MutableString/*!*/ CreateBinary(byte[]/*!*/ bytes, int start, int length) { At the moment you have to do something like: MutableString str = MutableString.CreateBinary(); str.Append(buffer, 0, received); Pete

Re: [Ironruby-core] RubyForge bug fixes

2008-05-11 Thread Peter Bacon Darwin
Hi Unnikrishnan, Just a couple of points you might find useful: . A number of overloads have parameters like ..., object/*!*/ path, ... What you are saying to the Specsharp tool is that object should never be null. Is this what you want? Can you pass nil into the methods in MRI? If you