Possible solution for export : `unittest export`?

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 1 17:00:53 PDT 2015


On Tuesday, 1 September 2015 at 18:11:02 UTC, deadalnix wrote:
> Ok I get it. I'm not sure that is the right way forward.

I am not sure either but we have lack of ideas in this domain, 
brainstorming :)

> The same problem arrise for devirtualization and the solution 
> does not cover it. That is a problem.

Can you expand on this problem a bit more please? I know about 
issue of not knowing if some method is eventually overridden but 
that seems to be fixed with export within single compilation step 
(i.e. small static library). Do you mean something different?

> First I'd like to have more compiler checks on template bodies. 
> Andrei and Walter are not super happy with it, but deep down I 
> do think their point is more the result of the clash with the 
> C++ community over static if vs concept than based on any 
> technical merit (the whole thing is a false dichotomy to start 
> with so the clash and its results are nonsensical).

I don't think it is even practical to try pushing in that 
direction at this point even if I generally agree with statement. 
Unless you are going to propose to restrict what exported 
templates can do (0 chance to fly) there still needs to be _some_ 
solution that works if existing semantics.

> Second, it is most likely a good idea to issue some kind of 
> error when export within template code calls non export code. 
> That most likely needs to be an error. The error would show up 
> with descent test coverage even without the special feature.

Isn't it essentially the same thing I propose, but simply based 
on convention instead of dedicated feature? It is probably fine 
but to be honest I think it really does matter to have clear 
indicator "this is how things are supposed to be done" in this 
domain. Simply because applying idioms from other languages will 
be natural course of actions and is unlikely it work in practice.


More information about the Digitalmars-d mailing list