tfpt review "/shelveset:MiscConversions;REDMOND\tomat"
DLR:
Fixes ReflectionUtils.FormatTypeName so that it formats generic type
definitions as C# does - using empty type names: C<,> instead of C<K,V>.
Ruby:
1) A Ruby class corresponding to a CLR generic type definition is now a
super-class of all instantiations of that type. So for example, List<> is a
super-class of List<int>, List<string>, etc. Similarly all instantiations of a
generic interface include the module that corresponds to their generic
interface definition. This allows to add methods to the generic definition and
call them from any instantiation. For example,
include System::Collections::Generic
class List
def foo
p self.class
end
end
List.of(Fixnum).new.foo # => System::Collections::Generic::List[Fixnum]
List.of(String).new.foo # => System::Collections::Generic::List[String]
2) Implements TypeGroup#[] overload taking a Fixnum. This is useful when one
needs to select a generic type definition out of a group of types. For example,
given three classes C:
public class C {
public virtual int Arity { get { return 0; } }
}
public class C<T> {
public virtual int Arity { get { return 1; } }
}
public class C<T,S> {
public virtual int Arity { get { return 2; } }
}
p C[0] # => C
p C[1] # => C[T]
p C[2] # => C[T, S]
Note that the resulting classes are not generic instantiations - they are still
generic definitions and need to be instantiated.
3)
Maps [] and []= on CLR arrays to Get/Set methods. This enables to apply Ruby
conversions on array elements assignment.
Changes CLR array factories so that they perform conversions of elements like
so:
class C
def to_str; 'c'; end
end
System::Array[System::String].new(3, C.new) # => ['c',
'c', 'c']
System::Array[String].new([C.new, C.new]) # =>
["c", "c", "c"]
System::Array[System::Byte].new(3) { |x| x + 1 } # => [1
(Byte), 2 (Byte), 3 (Byte)]
4)
Implements an explicit conversion of MutableString to System:Char.
Adds some error checks to initializers generator.
Adds AliasMethodAttribute so that library classes can declaratively alias
methods.
Fixed bug:
http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=1681
Tomas
_______________________________________________
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core