0
votes
Vote UpVote

Yield return and Delphi

Delphi sorcery – Well, some may know that Sergey Antonov already came up with some implementation on the yield functionality for Delphi in 2007. It was pretty impressive but for my taste it involved to much asm stuff and it was before Delphi had generics.So what if we could do something like this?for i in Power(2, 10) dobegin Writeln(i);end;Well, you can! All you need is define the function as follows:function Power(ANumber, AExponent: Integer): IEnumerable<Integer>;begin Result := TDelegateEnumerable<Integer>.Create( procedure var i, k: Integer; Result: Yield<Integer>; ...
Favorite? Off-Topic? noreply@blogger.com @ 2011-04-17 00:18

Statistics

Visits: 42
Votes: 0
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

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)