Cumulative
Steve Teale
steve.teale at britseyeview.com
Tue Feb 25 02:23:31 PST 2014
On Tuesday, 25 February 2014 at 03:13:23 UTC, Shammah Chancellor
wrote:
> So far as I'm understanding this thread, Steve Teale is asking
> for a way to inject code before and after a call to a function
> from other places in the program. E.g. Write some function
> foo, write some function bar, and specify that any time foo is
> called, bar should be called immediately after *automagically*.
>
> The reason this hasn't been done in any language I'm aware of
> is because you can solve the same problem using existing
> polymorphism, and it's a horribly awful design practice to have
> hidden code like that.
>
>
It's a bit more specific than 'from other places in the program',
and anyway, once you've accepted virtual functions, you've
accepted 'automagic' ;=)
I'm writing a little example program that illustrates what I'm
getting at, and I'll post it somewhere when I'm through.
Steve
More information about the Digitalmars-d
mailing list