November 11, 2007 Re: Full closures for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | the lazy keyword was introduced with a hint to the logging use case. "Save the performance of evaluating the string if logging is disabled." void log( lazy char[] msg ){ ... } ... char[] str = f(); log( "my message: "~str ); With full closures, is this an implicit "taking an address of a local function" that triggers a heap allocated stack frame? If yes, the stack frame is allocated without the need for. this would be counter productive in the logging use case. If no, everything is perfect i think. :) |
Copyright © 1999-2021 by the D Language Foundation