Question:
Is there a way to do duck typing with Delphi 2007 (i.e. without generics and advanced Rtti features)?
Duck typing Resources for Delphi 2010 onward:
- Duck Duck Delphi in google project by ARCANA.
- Duck Typing in Delphi by Daniele Teti.
- AOP and duck typing in Delphi by Stefan Glienke.
Last Edit:
I’ve delved more into the resouces listed above and studied every posted answers here.
I end up refining my requirement a made a follow up post to this question.
With the help of the ObjAuto.pas and invokable variant types it should be possible (written in XE but should also run in Delphi 7 or lower):
You can simply use it like this: