Re: Passing private functions to template algorithms

2016-06-12 Thread Timon Gehr via Digitalmars-d
On 12.06.2016 15:52, Timon Gehr wrote: semantics are useful is useful

Re: Passing private functions to template algorithms

2016-06-12 Thread Timon Gehr via Digitalmars-d
On 12.06.2016 13:05, Dicebot wrote: On 06/12/2016 01:55 PM, Timon Gehr wrote: On 12.06.2016 10:28, Dicebot wrote: On 06/07/2016 09:59 PM, Timon Gehr wrote: I think it is obvious that this should work. Visibility checks need to happen during identifier lookup. This lookup is happening in the

Re: Passing private functions to template algorithms

2016-06-12 Thread Artur Skawina via Digitalmars-d
The language does not prevent taking the address of a private symbol and escaping it. The alias case isn't (ie shouldn't be) different. artur

Re: Passing private functions to template algorithms

2016-06-12 Thread Dicebot via Digitalmars-d
On 06/12/2016 01:55 PM, Timon Gehr wrote: > On 12.06.2016 10:28, Dicebot wrote: >> On 06/07/2016 09:59 PM, Timon Gehr wrote: >>> I think it is obvious that this should work. Visibility checks need to >>> happen during identifier lookup. This lookup is happening in the module >>> where

Re: Passing private functions to template algorithms

2016-06-12 Thread Timon Gehr via Digitalmars-d
On 12.06.2016 10:28, Dicebot wrote: On 06/07/2016 09:59 PM, Timon Gehr wrote: I think it is obvious that this should work. Visibility checks need to happen during identifier lookup. This lookup is happening in the module where isFileNothrow is visible. My understanding is that right now

Re: Passing private functions to template algorithms

2016-06-12 Thread Dicebot via Digitalmars-d
On 06/07/2016 09:59 PM, Timon Gehr wrote: > I think it is obvious that this should work. Visibility checks need to > happen during identifier lookup. This lookup is happening in the module > where isFileNothrow is visible. My understanding is that right now template alias argument means

Re: Passing private functions to template algorithms

2016-06-08 Thread deadalnix via Digitalmars-d
On Wednesday, 8 June 2016 at 05:51:38 UTC, Stefan Koch wrote: If I had a specific case in mind I would have provided it. Then is is FUD.

Re: Passing private functions to template algorithms

2016-06-08 Thread Max Samukha via Digitalmars-d
On Tuesday, 7 June 2016 at 18:59:03 UTC, Timon Gehr wrote: I think it is obvious that this should work. Visibility checks need to happen during identifier lookup. This lookup is happening in the module where isFileNothrow is visible. There is also this inconsistency: module a;

Re: Passing private functions to template algorithms

2016-06-08 Thread Max Samukha via Digitalmars-d
On Wednesday, 8 June 2016 at 00:48:00 UTC, Stefan Koch wrote: On Tuesday, 7 June 2016 at 18:59:03 UTC, Timon Gehr wrote: I think it is obvious that this should work. Visibility checks need to happen during identifier lookup. This lookup is happening in the module where isFileNothrow is

Re: Passing private functions to template algorithms

2016-06-08 Thread Basile B. via Digitalmars-d
On Tuesday, 7 June 2016 at 18:45:23 UTC, FreeSlave wrote: I want to bring up this unpleasant topic for discussion, because I'm really tired of hacks I need to do in my code. [...] How about allowing templates from other modules to have access to private functions? I think this would be

Re: Passing private functions to template algorithms

2016-06-07 Thread Stefan Koch via Digitalmars-d
On Wednesday, 8 June 2016 at 00:58:41 UTC, deadalnix wrote: On Wednesday, 8 June 2016 at 00:48:00 UTC, Stefan Koch wrote: I agree with you. However something in the back of my mind tells me that we'll be hitting nasty corner cases if we change the behavior. Unless you can provide such corner

Re: Passing private functions to template algorithms

2016-06-07 Thread deadalnix via Digitalmars-d
On Wednesday, 8 June 2016 at 00:48:00 UTC, Stefan Koch wrote: On Tuesday, 7 June 2016 at 18:59:03 UTC, Timon Gehr wrote: I think it is obvious that this should work. Visibility checks need to happen during identifier lookup. This lookup is happening in the module where isFileNothrow is

Re: Passing private functions to template algorithms

2016-06-07 Thread Stefan Koch via Digitalmars-d
On Tuesday, 7 June 2016 at 18:59:03 UTC, Timon Gehr wrote: I think it is obvious that this should work. Visibility checks need to happen during identifier lookup. This lookup is happening in the module where isFileNothrow is visible. I agree with you. However something in the back of my

Re: Passing private functions to template algorithms

2016-06-07 Thread Timon Gehr via Digitalmars-d
On 07.06.2016 20:45, FreeSlave wrote: I want to bring up this unpleasant topic for discussion, because I'm really tired of hacks I need to do in my code. Look at this snippet: private bool isFileNothrow(string path) { import std.file : isFile; import std.exception : collectException;

Passing private functions to template algorithms

2016-06-07 Thread FreeSlave via Digitalmars-d
I want to bring up this unpleasant topic for discussion, because I'm really tired of hacks I need to do in my code. Look at this snippet: private bool isFileNothrow(string path) { import std.file : isFile; import std.exception : collectException; bool ok;