Discussion Thread: DIP 1044--Enum Type Inference--Community Review Round 1

Walter Bright newshound2 at digitalmars.com
Tue Nov 22 00:41:54 UTC 2022


On 11/20/2022 2:03 AM, Timon Gehr wrote:
> To some extent I think this is the case, but function literals already defer the 
> semantic pass in some way, so it seems feasible.

True, and templates also make a copy of the AST before instantiating it. But:

1. template compilation is not known for speed or low memory consumption

2. every function argument would have to be copied first, as it wouldn't know 
about $ processing in advance (or have to make a pass over it first to detect it)

3. if there were, say, 5 occurrences of $a, each of that which could be 2 
different instances to try, what's that, 32 copies

I'm not too thrilled about this.


More information about the Digitalmars-d mailing list