November 22

On Tuesday, 22 November 2022 at 00:41:54 UTC, Walter Bright wrote:

>
  1. 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.

The moment you know there are 2 instances with different enum type parameters that both have an a member, you can return an error. Also why do you expect 2 functions to look up a member a in 5 different enums? Just limit the search to the enums in the function parameters.

November 22
On Tuesday, 22 November 2022 at 00:42:43 UTC, Walter Bright wrote:
> On 11/20/2022 8:25 AM, IchorDev wrote:
>> If you're sure that arithmetic and ETI won't mix for implementation reasons then I could explicitly prohibit it. My only apprehension is that `OR`ing enum flags with ETI is very handy.
>
> It is handy and used a lot.

OK so you have no issue with the arithmetic? Cool.
November 22

On Tuesday, 22 November 2022 at 01:43:25 UTC, Timon Gehr wrote:

>

_.member is also missing.

_.member could break existing code, sorry. :(

November 22

On Monday, 21 November 2022 at 16:23:51 UTC, IchorDev wrote:

>

If you'd like to vote about what ETI syntax you'd prefer, I've opened a poll to keep track of how many people like which syntax.
The options I've listed are limited to ones that don't break compatibility with existing code. If you'd like an option added, let me know.
https://strawpoll.com/polls/PKglzqaGJyp

Something to note about the poll:
If you don’t enter a proper name, I might not count your vote.
Entering a name that’s recognisable helps.

Please vote if you have the time! It'll help me figure out which option is most popular. :)

November 22
On 22/11/2022 5:19 PM, IchorDev wrote:
> Please vote if you have the time! It'll help me figure out which option is most popular. 😄

You left out "no syntax" so I can't vote for anything!
November 22
On Tuesday, 22 November 2022 at 04:27:18 UTC, rikki cattermole wrote:
> On 22/11/2022 5:19 PM, IchorDev wrote:
>> Please vote if you have the time! It'll help me figure out which option is most popular. 😄
>
> You left out "no syntax" so I can't vote for anything!

That's not a meaningful preference for the sake of "which one should the DIP propose in its next revision". For instance, if everyone voted for "no syntax" then the poll would be useless to me.
November 22
On 22/11/2022 6:47 PM, IchorDev wrote:
> For instance, if everyone voted for "no syntax" then the poll would be useless to me.

But it would tell you something useful.

It would suggest a lot of people are wanting to explore semantic behavior instead. Such as Walter's alternative proposal idea.
November 22
On Tuesday, 22 November 2022 at 05:55:04 UTC, rikki cattermole wrote:
> On 22/11/2022 6:47 PM, IchorDev wrote:
>> For instance, if everyone voted for "no syntax" then the poll would be useless to me.
>
> But it would tell you something useful.
>
> It would suggest a lot of people are wanting to explore semantic behavior instead. Such as Walter's alternative proposal idea.

If it's not implemented with .identifier then I will oppose it.

I don't buy the "it will break code" point of view either.

The only thing I can think of that will break is that .identifier already has a meaning today that means module scope.

But that could easily mean module AND "static/scoped" lookup and any ambiguity can be fixed by prioritization.

1. module scope 2. enum 3. static members of ex. classes

So if you type .a then it will first look in module scope, then in enums that are in scope and at last within classes that are in scope.

I suggested something like it earlier too.

Anything that is more complicated than .identifier is not worth it and will only introduce unncessary complexity to the language syntax.

Example:

```d
class A { static int a = 1; static int b = 2; }
enum B { b = 3, c = 4 }
int c = 5;

void main() {
  writeln(.a);
  writeln(.b);
  writeln(.c);
}
```

Prints:

1
3
5
November 22

On Tuesday, 22 November 2022 at 09:37:43 UTC, bauss wrote:

>

Example:

class A { static int a = 1; static int b = 2; }
enum B { b = 3, c = 4 }
int c = 5;

void main() {
  writeln(.a);
  writeln(.b);
  writeln(.c);
}

Prints:

1
3
5

class A { static int a = 1; static int b = 2; }
enum B { b = 3, c = 4 }
int c = 5;

void main() {
  with A,B;
  writeln(a);
  writeln(b);
  writeln(c);
}
November 22

On Tuesday, 22 November 2022 at 10:06:24 UTC, zjh wrote:

>
class A { static int a = 1; static int b = 2; }
enum B { b = 3, c = 4 }
int c = 5;

void main() {
  with A,B;
  writeln(a);
  writeln(b);
  writeln(c);
}

Here are two b, disambiguation is required in any case.