digitalmars.D - Delphi, virtual method interception
- bearophile (6/6) Aug 15 2011 Despite not being very cool, Delphi language has kept improving. Delphi ...
- bearophile (10/10) Aug 15 2011 In Delphi Prism there is the colon operator too:
- Jacob Carlborg (4/14) Aug 16 2011 That's a nice feature, several other languages has the same feature as w...
- Marco Leise (5/14) Aug 15 2011 Oh come on, Delphi is cool! Don't you see how I cite it everywhere
- Jacob Carlborg (4/10) Aug 16 2011 Seems like opDispatch, but for virtual methods.
Despite not being very cool, Delphi language has kept improving. Delphi language and D shares all (or most) of their design goals. This page found through Reddit shows features added to Delphi since 2005: http://www.tindex.net/ From that page this TVirtualMethodInterceptor recently added in Delphi XE seems interesting: http://blog.barrkel.com/2010/09/virtual-method-interception.html Bye, bearophile
Aug 15 2011
In Delphi Prism there is the colon operator too: http://prismwiki.codegear.com/en/Colon_Operator A quote from another page: instead of using "." to access members and get a NullReferenceException if they are nil, use ":" and the call will be skipped for nil (and the result will be nil itself). For example: // only call dispose if the interface is implemented. IDisposable(SomeObject):Dispose; // access the 3rd parent of a control, where any level might be nil. x := Button:Parent:Parent:Parent; Bye, bearophile
Aug 15 2011
On 2011-08-16 01:48, bearophile wrote:In Delphi Prism there is the colon operator too: http://prismwiki.codegear.com/en/Colon_Operator A quote from another page: instead of using "." to access members and get a NullReferenceException if they are nil, use ":" and the call will be skipped for nil (and the result will be nil itself). For example: // only call dispose if the interface is implemented. IDisposable(SomeObject):Dispose; // access the 3rd parent of a control, where any level might be nil. x := Button:Parent:Parent:Parent; Bye, bearophileThat's a nice feature, several other languages has the same feature as well. -- /Jacob Carlborg
Aug 16 2011
Am 16.08.2011, 01:25 Uhr, schrieb bearophile <bearophileHUGS lycos.com>:Despite not being very cool, Delphi language has kept improving. Delphi language and D shares all (or most) of their design goals. This page found through Reddit shows features added to Delphi since 2005: http://www.tindex.net/ From that page this TVirtualMethodInterceptor recently added in Delphi XE seems interesting: http://blog.barrkel.com/2010/09/virtual-method-interception.html Bye, bearophileOh come on, Delphi is cool! Don't you see how I cite it everywhere possible, like on the D.learn thread about integer vs. float division where Pascal's 'div' and 'mod' come to the rescue. I'm just waiting for the ideal moment to talk about sets of enum values.
Aug 15 2011
On 2011-08-16 01:25, bearophile wrote:Despite not being very cool, Delphi language has kept improving. Delphi language and D shares all (or most) of their design goals. This page found through Reddit shows features added to Delphi since 2005: http://www.tindex.net/ From that page this TVirtualMethodInterceptor recently added in Delphi XE seems interesting: http://blog.barrkel.com/2010/09/virtual-method-interception.html Bye, bearophileSeems like opDispatch, but for virtual methods. -- /Jacob Carlborg
Aug 16 2011