DCSIMG
generics - IronShay

Browse by Tags

All Tags » generics (RSS)

IronRuby Tip: Using Generic CLR Methods from IronRuby

A while ago I wrote a post about using Generic CLR classes from IronRuby . This time I’ll share with you its less intuitive friend – using generic CLR methods from IronRuby. As a result of Ruby being a duck-typed language which works with types implicitly, generics is not really needed. The whole language is generic… This is why using generic CLR types might become a bit odd for the language. Nonetheless, this fact will not stop us. The price to pay in order to enjoy Ruby in the .Net framework is...
Posted by shayf | 1 comment(s)

Return Type Generic Method

This time I'd like to introduce you with a sample code I've written... I'll be talking about creating a method with a generic return type. Currently, the .Net Framework supports parameter overloading but does not support return type overloading. A method with a generic return type means that you can pass the return type to the method and get the result as this type (SampleMethod<string>() will return a string and SampleMethod<bool>() will return a bool value) - a little workaround...
Posted by shayf | 1 comment(s)