Implements Yield for Delphi
Book information
Description
The Russian Delphi programmer Sergey Antonov (or Антонов Сергей - aka. 0xffff) is a real hacker in the positive sense. He approached me with some intriguing assembly code that implements the equivalent of the C# yield statement!Yield makes it easier to implement enumerators (you know the simple classes or records with methods like GetCurrent and MoveNext that enables the for-in statement). Normally you have to implement a kind of state-machine to write an enumerator. With the yield statement this is turned around allowing you to express the iteration using easier to write loops (while, repeat-until or even a for-in loop). Sergey has pulled the impressive feat of implementing a proof-of-concept version of a yield infrastructure and mechanics - without help from the compiler! It may have some limitations, but it is most interesting anyway. Without further ado, here is Sergey's article and code. Make sure you also read the follow-up article on Sergey's blog. Despite some minor language barriers ;), this will be a most interesting blog to follow!Guest article, by Sergey AntonoV
Similar books
Cross Platform Development with Delphi XE7 & FireMonkey for Windows & MAC OS X
RAR
Object Oriented Two-Dimensional Graphics in a Borland Delphi Environment
Ribbon Controls в Delphi 2010. Визуальная разработка интерфейса программы
Delphi Cookbook: 50 hands-on recipes to master the power of Delphi for cross-platform and mobile development on Windows, Mac OS X, Android, and iOS
Delphi. Программирование для Windows, OS X, iOS и Android (+ sources)
RAR
Практикум по программированию на Delphi XE3: Лучшие практические занятия для программистов на языке Delphi! (Сокращённый вариант)
RAR
Уроки по базам данных в Delphi
RAR
Delphi на пальцах. Осваиваем новые технологии Windows 8: Touch и Gesture
RAR