On Mon, 05 Jan 2015 21:14:58 +0000 Zach the Mystic via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> Hello everybody. My name is Zach, and I have a suggestion for the > improvement of D. I've been looking at the following stalled pull > request for a while now: > > https://github.com/D-Programming-Language/dmd/pull/1877 heh. i did a little hack based on this patch: autoinference is turned on only for `private auto`. i also added a bunch of UDAs to control the process: `@inferattr` (can be applied to any function), `@notinferattr`, `@canthrow`, `@impure` and `@gc` (to control inference). any explicit attribute on function will block inference too. as druntime and phobos has no `private auto` which is not templated or without explicit attribues, it compiles fine. and for my code i have some control. this feature can be poorly designed, but as it doesn't conflict with most of the existing code, i'm happy with it. one should be carefull with templates calling private functions with inferred attributes (it breaks linking -- for obvious reason), but it's ok for me. `private auto` is so ugly that it will rise my alarm level anyway. i mean "function returning 'auto' is suspicious".
signature.asc
Description: PGP signature