1
vote
Vote UpVote

RubyMania has reached Delphi – Times helper method implementation for integers – from Asbjørn Heid

The Wiert Corner – The below fragment is one of the favourite kinds of examples in the Ruby world: 5.times { |i| print i, " " } It uses the times method on Integer and prints: 0 1 2 3 4 There are many implementations of this in other languages, for instance Ruby’s ‘times()’ function in C# | Of Code and Me (which the WordPress.com editor fucked up as it replaced Action<int> with Action which is a totally different thing, so the gist with code is below. public static class IntExtensions { public static void Times(this int i, Action func) { for(int j = 0; j < i; j++) { ...
Favorite? Off-Topic? jpluimers @ 2016-04-21 13:00

Statistics

Visits: 1532
Votes: 1
Favorites: 0
Off-Topic: 1

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)