On 3/16/17 10:52 AM, Kagamin wrote:
On Monday, 6 March 2017 at 18:06:27 UTC, Andrei Alexandrescu wrote:
On 3/6/17 8:42 AM, Kagamin wrote:
v1==v2;

can be lowered as

{
  import rthelpers:cmp;
  cmp(v1,v2);
}

or something like that

Interesting idea, will keep it in mind. Thanks! -- Andrei

Even better:

in object.d:
---
public import _d_helpers=core.helpers;
---

lowering:
---
v1==v2
to
_d_helpers.cmp(v1,v2)
---

This has the best scalability and zero possibility of code breakage and
probably can be done right now. Also since the renamed import must be
referenced explicitly, it doesn't need to be processed until used.

A public import inside object.d is not useful because essentially it opens more files to load the same amount of code. Generally, there are a few interesting tradeoffs that govern handling of modularity in object.d. -- Andrei

Reply via email to