Delphi Defer

Versão deste artigo em Português Few weeks ago I was refactoring my framework “Foundation 4 Delphi”, I had to extend the TComponent.TRecursiveEnumerator to be used in other classes, it was a very old implementation and I decided to rewrite with generics and take advantage of smart records to simplify the integration with my TComponentHelper class helper. In the record’s implementation, I had to create a “IInterface” field just to be able to simulate a destructor in the record, when I thought how great would be if we had the Defer function as in Golang.

Continue Reading »