Skip to content

slavikdev/rush

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rush: Productive Ruby Features in C# .NET

Increase productivity by useful Ruby language features available in C# .NET.

Build status

Iterators

Times iterator

Ruby:

5.times { puts "Hello" }
10.times { |i| puts "Hello #{i}" }

C#:

5.Times( () => Console.WriteLine( "Hello" ) );
10.Times( i => Console.WriteLine( "Hello, {0}", i ) );

Each iterator

Ruby:

"hello".each { |ch| print ch }
"message".each_with_index { |ch,i| puts "#{i} is #{ch}" }

C#:

"hello".Each( ch => Console.Write( ch ) );
"message".Each( (ch, i) => Console.WriteLine( "{0} is {1}", i, ch ) );