Walter Bright wrote:
Stewart Gordon wrote:
I'm still none the wiser about why it absolutely has to be done like
this instead of the simpler solution I proposed years ago.
Can you refresh my memory?
Seems straightforward to find to me, but here it is:
http://www.digitalmars.com/d/archives/digitalmars/D/31595.html
(The nested function approach is fairly simple in terms of lines of code
to implement.)
I can imagine how it works now. Essentially it's a function that can
act as a nested function to the function for which it is originally
defined or any override of it, which works since a nested function is
really just a function with a pointer to the outer function's stack
frame as a parameter. Correct?
BTW I just rediscovered this old thread
http://www.digitalmars.com/d/archives/digitalmars/D/9775.html
which is making me think we probably ought to enable contracts on
bodyless functions some time.
Stewart.