[Ironruby-core] Code Review: re

Shri Borde Shri.Borde at microsoft.com
Mon Feb 23 15:44:27 EST 2009

Array.Sort(methods, ...) does not work because methods is an IEnumerable, not IList, and so I have to create an auxiliary list. I did use the inline lambda for the comparision delegate. Changed TransformConcatenation too.


-----Original Message-----
From: Tomas Matousek 
Sent: Monday, February 23, 2009 11:15 AM
To: Shri Borde; IronRuby External Code Reviewers
Cc: ironruby-core at rubyforge.org
Subject: RE: Code Review: re

ReflectionCacheGenerator: More concise way how to sort an array: 

var methods = ReflectMethods(typeof(RubyOps)).Values;
Array.Sort(methods, (m1, m2) => m1.Name.CompareTo(m2.Name));


I would prefer TransformConcatenation to take 2 parameters (Expr regexOptions, Expr regexCache) rather than params array.

Then this would not be necessary:
                    List<MSA.Expression> allArgs = new List<MSA.Expression>(2 + additionalArgs.Length);

and we could do just:
			  if (regexOptions != null) 
                      opFactory("N").OpCall(paramArray, codePage, regexOptions, regexCache) : ...

Other than that looks good.


-----Original Message-----
From: Shri Borde 
Sent: Monday, February 23, 2009 10:11 AM
To: IronRuby External Code Reviewers
Cc: ironruby-core at rubyforge.org
Subject: Code Review: re

  tfpt review "/shelveset:re;REDMOND\sborde"

  Comment  : 
  Regexp literal support for /o.
  /foo/ should compare equal with /foo/o, so we ensure that RubyRegexpOptions.Once is passed into the RubyOps runtime helper, but we then remove it in the RubyRegex constructor
  Caching of the RubyRegex (and the underlying System.Text.RegularExpressions.Regex) for regexp literals so that the expression is processed only once
  Sort the method names in the generated ReflectionCache. This will make reduce the chances of conflicts during merging. Currently, the order is whatever System.Reflection choses.

More information about the Ironruby-core mailing list