DIP64: Attribute Cleanup
Marco Leise via Digitalmars-d
digitalmars-d at puremagic.com
Mon Apr 18 16:46:13 PDT 2016
Am Mon, 18 Apr 2016 20:49:45 +0000
schrieb jmh530 <john.michael.hall at gmail.com>:
> As an aside, the reason for not having function attribute
> inference everywhere is that it doesn't work when function bodies
> are not available. How common is this? I feel like I never write
> functions like this. Why not just make the rule that if the
> function body is available, then inference will happen?
Just because you don't know about it doesn't mean it's
non-existent. ;)
Imagine we had LibreOffice and Gtk+ or some other library with
many dependencies written in D. But even Phobos is a good
start. If all function bodies were available for attribute
inference that would start a cascade that requires the
compiler to perform semantic analysis on all of LibreOffice,
Gtk+ and whatever else is imported. It goes without further
explanation that this doesn't scale and .di files have to be
used at library boundaries.
--
Marco
More information about the Digitalmars-d
mailing list