Why I love D: function parameter reification

Adam D Ruppe destructionator at gmail.com
Thu Jun 9 11:49:32 UTC 2022


On Thursday, 9 June 2022 at 11:43:36 UTC, bauss wrote:
> I really can't see any reason to reject it, it's not like it'll 
> impact anything at all really.

The stated reason was an ideology that someone might misuse it to 
sneak semantic info into comments.

The compiler implementation also discards them unless you use the 
-D switch, but that'd be fairly easy to fix (or even letting it 
stay blank unless you passed the switch would probably be 
acceptable too) so implementation shouldn't be a big deal, but 
then we're told that'd increase memory usage and compile times. 
Cuz I'm sure some text comments are a big concern.

> But it really would be useful for tooling, error messages, 
> validation etc.
>
> Could in theory be used to create automated unittests by 
> extracting code examples from the docs.

Yeah, or even just pulling in for for wrapped script languages, 
auto-generated command line help or web site forms. Lots of nice 
little things.


More information about the Digitalmars-d mailing list