Re: On attribute inference...

2016-04-19 Thread Walter Bright via Digitalmars-d
On 4/18/2016 8:20 PM, Jonathan M Davis via Digitalmars-d wrote: Except that unfortunately, the compiler _does_ do attribute inference for auto return functions now, because the body is guaranteed to be available. Relying on that inference in a public API that's part of a library will easily lead

Re: On attribute inference...

2016-04-19 Thread Jacob Carlborg via Digitalmars-d
On 2016-04-19 10:57, Jonathan M Davis via Digitalmars-d wrote: However, there are some good arguments for not just exporting everything - particularly with regards to compilation efficiency. It's not that uncommon for a library to have a public API that everyone should see and use while having a

Re: On attribute inference...

2016-04-19 Thread Johannes Pfau via Digitalmars-d
Am Tue, 19 Apr 2016 01:57:21 -0700 schrieb Jonathan M Davis via Digitalmars-d : > I expect that hiding symbols which aren't public would certainly help > a great deal in avoiding having a lot of unnecessary symbols in a > compiled library, but it doesn't completely solve the problem. And > when di

Re: On attribute inference...

2016-04-19 Thread Satoshi via Digitalmars-d
On Tuesday, 19 April 2016 at 08:57:21 UTC, Jonathan M Davis wrote: On Tuesday, April 19, 2016 07:58:19 Satoshi via Digitalmars-d wrote: Why cannot be exported every public/protected method by default? When I am creating so/dll I want to export almost everything. Methods what I dont want to expo

Re: On attribute inference...

2016-04-19 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, April 19, 2016 07:58:19 Satoshi via Digitalmars-d wrote: > Why cannot be exported every public/protected method by default? > When I am creating so/dll I want to export almost everything. > Methods what I dont want to export I should mark as private or > package or package(nameOfRootPac

Re: On attribute inference...

2016-04-19 Thread Satoshi via Digitalmars-d
Why cannot be exported every public/protected method by default? When I am creating so/dll I want to export almost everything. Methods what I dont want to export I should mark as private or package or package(nameOfRootPackage).

Re: On attribute inference...

2016-04-18 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, April 19, 2016 03:27:46 Marco Leise via Digitalmars-d wrote: > No case makes the distinction between "function body > availability" and "API stability" more clear than auto return. > Even though their source code is copied verbatim into the .di > files to allow the return of voldemort t

On attribute inference...

2016-04-18 Thread Marco Leise via Digitalmars-d
Currently the compiler makes sure, that it can see the entire nested call chain when performing attribute inference. So it limits itself to function literals and templates where the source has to be right there for them to compile. The remaining functions could roughly be classified as functions t