On Tuesday, 25 April 2023 at 06:41:04 UTC, zjh wrote:
On Tuesday, 25 April 2023 at 04:54:43 UTC, Mike Parker wrote:
..
Is it okay to use a new keyword `enumswitch` that is equivalent
to `with final switch`?
Why would you use a new keyword? Use `enum switch` with a space.
Both are keywords
On Friday, 12 May 2023 at 03:11:49 UTC, ryuukk_ wrote:
On Thursday, 11 May 2023 at 23:00:03 UTC, epilogue wrote:
On Thursday, 11 May 2023 at 00:56:03 UTC, ryuukk_ wrote:
Don't you find this code easier to read and review?
```D
if (target.os == .Windows)
{
On Thursday, 11 May 2023 at 23:00:03 UTC, epilogue wrote:
On Thursday, 11 May 2023 at 00:56:03 UTC, ryuukk_ wrote:
Don't you find this code easier to read and review?
```D
if (target.os == .Windows)
{
item("windows");
}
else
{
On Thursday, 11 May 2023 at 00:56:03 UTC, ryuukk_ wrote:
Don't you find this code easier to read and review?
```D
if (target.os == .Windows)
{
item("windows");
}
else
{
item("posix");
if (target.os == .linux)
On 5/11/23 10:10 AM, Paul Backus wrote:
On Thursday, 11 May 2023 at 13:31:58 UTC, Steven Schveighoffer wrote:
On 5/10/23 11:22 PM, Paul Backus wrote:
In fact, for this particular example, there are actually two enums in
the DMD source code that these symbols could be coming from: `enum
On Thursday, 11 May 2023 at 13:31:58 UTC, Steven Schveighoffer
wrote:
On 5/10/23 11:22 PM, Paul Backus wrote:
In fact, for this particular example, there are actually two
enums in the DMD source code that these symbols could be
coming from: `enum TargetOS` in `cli.d`, and `enum OS` in
On 5/10/23 11:22 PM, Paul Backus wrote:
In fact, for this particular example, there are actually two enums in
the DMD source code that these symbols could be coming from: `enum
TargetOS` in `cli.d`, and `enum OS` in `target.d`. So you would have to
scroll up and look at the imports to
On Thursday, 11 May 2023 at 00:56:03 UTC, ryuukk_ wrote:
Don't you find this code easier to read and review?
```D
if (target.os == .Windows)
{
item("windows");
}
else
{
item("posix");
if (target.os == .linux)
I was reading DMD source code, case of repetition that adds
nothing of value but useless reading strain
https://github.com/dlang/dmd/blob/999d835c1196eb993a99bb7f1c863da265a6b6c0/compiler/src/dmd/json.d#L843-L869
```D
if (target.os == Target.OS.Windows)
{
On Monday, 1 May 2023 at 14:03:51 UTC, bachmeier wrote:
On Monday, 1 May 2023 at 00:34:03 UTC, ryuukk_ wrote:
I don't think it's a misconception. It's more like a complete
lack of clarity.
the goal is not to use an anonymous enum, the goal is to
leverage the robust type system to avoid
On Monday, 1 May 2023 at 14:03:51 UTC, bachmeier wrote:
```
value.type = STRING;
```
IRL people would use namespacing prefixes or actual namespaces
anyway, so your example would look more like
```
value.type = VALUE_TYPE_STRING;
```
On Monday, 1 May 2023 at 00:34:03 UTC, ryuukk_ wrote:
I don't think it's a misconception. It's more like a complete
lack of clarity.
the goal is not to use an anonymous enum, the goal is to
leverage the robust type system to avoid repeting yourself,
wich is bad
```
Value value;
value.type
Do you write this?
```
float myfloat = float(1.0);
```
Or this?
```
float myfloat = 1.0;
```
Why would it be different for enums (or any other type)
Also i suggest you to try all kind of languages to expand your
knowledge and to try out new UX that modern languages provide,
there is no
On Thursday, 27 April 2023 at 13:03:17 UTC, bachmeier wrote:
On Thursday, 27 April 2023 at 06:10:57 UTC, Basile B. wrote:
On Thursday, 27 April 2023 at 00:16:10 UTC, Walter Bright
wrote:
This also works:
alias F = MySuperLongNameFlag;
auto flag = F.A | F.B | F.C | F.D;
On Thursday, 27 April 2023 at 06:10:57 UTC, Basile B. wrote:
It's a misconception of the problem that the DIP tried to
solve. What the DIP tried to solve is that the compiler should
know that you are using an enum member. Actually I even think
this should work without any special syntax, as a
On Thursday, 27 April 2023 at 06:10:57 UTC, Basile B. wrote:
On Thursday, 27 April 2023 at 00:16:10 UTC, Walter Bright wrote:
This also works:
alias F = MySuperLongNameFlag;
auto flag = F.A | F.B | F.C | F.D;
set_flags(F.A | F.B | F.C | F.D);
It's similar to setting a local
On Thursday, 27 April 2023 at 00:16:10 UTC, Walter Bright wrote:
This also works:
alias F = MySuperLongNameFlag;
auto flag = F.A | F.B | F.C | F.D;
set_flags(F.A | F.B | F.C | F.D);
It's similar to setting a local variable to some complex
expression, just so you don't have to
This also works:
alias F = MySuperLongNameFlag;
auto flag = F.A | F.B | F.C | F.D;
set_flags(F.A | F.B | F.C | F.D);
It's similar to setting a local variable to some complex expression, just so you
don't have to repeat that expression multiple times.
On Wednesday, 26 April 2023 at 14:54:40 UTC, max haughton wrote:
https://github.com/dlang/dmd/pull/13776
Wow, didn't know about this PR exists. Thank you for sharing!
On 4/26/2023 1:19 AM, Stefan Koch wrote:
While it is true that it only implements a subset of the proposal.
It does implemnent function overloading for non-templated functions the specific
code for this is here:
On Wednesday, 26 April 2023 at 15:07:36 UTC, ryuukk_ wrote:
Again, all of this was covered and argumented during the DIP
discussion
The goal is to improve the language, not find excuses or
workarounds, don't defend obfuscation, move forward
Your proposals were built on unrealistic examples
On Wednesday, 26 April 2023 at 13:08:22 UTC, Jacob Shtokolov
wrote:
On Wednesday, 26 April 2023 at 12:50:32 UTC, bachmeier wrote:
Many other solutions were provided as well, including but not
limited to
- Using shorter names
- Using alias
- Using an IDE with autocomplete
- Using copy and
On Wednesday, 26 April 2023 at 12:50:32 UTC, bachmeier wrote:
On Wednesday, 26 April 2023 at 11:52:31 UTC, Jacob Shtokolov
wrote:
On Tuesday, 25 April 2023 at 20:15:39 UTC, ryuukk_ wrote:
void set_connected()
{
network_connect_state = NetworkConnectState.CONNECTED
}
MySuperLongNameFlag
On Wednesday, 26 April 2023 at 10:48:21 UTC, Greggor wrote:
On Tuesday, 25 April 2023 at 04:54:43 UTC, Mike Parker wrote:
I submitted DIP1044, "Enum Type Inference", to Walter and
Atila on April 1. I received the final decision from them on
April 18. They have decided not to accept this
On Wednesday, 26 April 2023 at 11:52:31 UTC, Jacob Shtokolov
wrote:
On Tuesday, 25 April 2023 at 20:15:39 UTC, ryuukk_ wrote:
void set_connected()
{
network_connect_state = NetworkConnectState.CONNECTED
}
MySuperLongNameFlag flag = MySuperLongNameFlag.A |
MySuperLongNameFlag.B |
On Wednesday, 26 April 2023 at 13:08:22 UTC, Jacob Shtokolov
wrote:
On Wednesday, 26 April 2023 at 12:50:32 UTC, bachmeier wrote:
Many other solutions were provided as well, including but not
limited to
- Using shorter names
- Using alias
- Using an IDE with autocomplete
- Using copy and
On Tuesday, 25 April 2023 at 04:54:43 UTC, Mike Parker wrote:
I submitted DIP1044, "Enum Type Inference", to Walter and Atila
on April 1. I received the final decision from them on April
18. They have decided not to accept this proposal.
[...]
While I was rather "pro" I think that D lacked
On Wednesday, 26 April 2023 at 12:50:32 UTC, bachmeier wrote:
Many other solutions were provided as well, including but not
limited to
- Using shorter names
- Using alias
- Using an IDE with autocomplete
- Using copy and paste
While aliases and shorter names are always good options,
On Tuesday, 25 April 2023 at 04:54:43 UTC, Mike Parker wrote:
I submitted DIP1044, "Enum Type Inference", to Walter and Atila
on April 1. I received the final decision from them on April
18. They have decided not to accept this proposal.
This was the right decision, but it would have been
On Wednesday, 26 April 2023 at 11:52:31 UTC, Jacob Shtokolov
wrote:
On Tuesday, 25 April 2023 at 20:15:39 UTC, ryuukk_ wrote:
void set_connected()
{
network_connect_state = NetworkConnectState.CONNECTED
}
MySuperLongNameFlag flag = MySuperLongNameFlag.A |
MySuperLongNameFlag.B |
On Tuesday, 25 April 2023 at 20:15:39 UTC, ryuukk_ wrote:
void set_connected()
{
network_connect_state = NetworkConnectState.CONNECTED
}
MySuperLongNameFlag flag = MySuperLongNameFlag.A |
MySuperLongNameFlag.B | MySuperLongNameFlag.C |
MySuperLongNameFlag.D;
On Tuesday, 25 April 2023 at 04:54:43 UTC, Mike Parker wrote:
I submitted DIP1044, "Enum Type Inference", to Walter and Atila
on April 1. I received the final decision from them on April
18. They have decided not to accept this proposal.
[...]
I’m going to contribute to the peanut gallery,
On Wednesday, 26 April 2023 at 01:39:14 UTC, Walter Bright wrote:
That only does a subset of the proposal. The inference only
works in specific cases. Things like function overloading are
not addressed.
Should we remove struct initializers as well?
```D
struct S { int x; }
void fun(S) {}
On Wednesday, 26 April 2023 at 01:39:14 UTC, Walter Bright wrote:
On 4/25/2023 1:15 PM, ryuukk_ wrote:
Or perhaps, listen to this person:
https://github.com/dlang/dmd/pull/14650
That only does a subset of the proposal. The inference only
works in specific cases. Things like function
On Wednesday, 26 April 2023 at 01:39:14 UTC, Walter Bright wrote:
On 4/25/2023 1:15 PM, ryuukk_ wrote:
Or perhaps, listen to this person:
https://github.com/dlang/dmd/pull/14650
That only does a subset of the proposal. The inference only
works in specific cases. Things like function
On Wednesday, 26 April 2023 at 01:26:03 UTC, Walter Bright wrote:
On 4/25/2023 4:12 PM, max haughton wrote:
I have never been in favour of D having bitfields. This isn't
worth breaking stuff for.
D bitfields didn't break anything. Also, it exposed an
overlooked bug in the ImportC bitfields.
On 4/25/2023 1:15 PM, ryuukk_ wrote:
Or perhaps, listen to this person: https://github.com/dlang/dmd/pull/14650
That only does a subset of the proposal. The inference only works in specific
cases. Things like function overloading are not addressed.
On 4/25/2023 4:12 PM, max haughton wrote:
I have never been in favour of D having bitfields. This isn't worth breaking
stuff for.
D bitfields didn't break anything. Also, it exposed an overlooked bug in the
ImportC bitfields.
On Tuesday, 25 April 2023 at 22:39:35 UTC, ryuukk_ wrote:
On Tuesday, 25 April 2023 at 20:59:23 UTC, max haughton wrote:
On Tuesday, 25 April 2023 at 20:15:39 UTC, ryuukk_ wrote:
On Tuesday, 25 April 2023 at 18:38:14 UTC, max haughton wrote:
[...]
Why you guys focus on "switch"
Because
On Tuesday, 25 April 2023 at 20:59:23 UTC, max haughton wrote:
On Tuesday, 25 April 2023 at 20:15:39 UTC, ryuukk_ wrote:
On Tuesday, 25 April 2023 at 18:38:14 UTC, max haughton wrote:
[...]
Why you guys focus on "switch"
Because that's the example given by Mike...
Who doesn't love writing
On Tuesday, 25 April 2023 at 20:15:39 UTC, ryuukk_ wrote:
On Tuesday, 25 April 2023 at 18:38:14 UTC, max haughton wrote:
[...]
Why you guys focus on "switch"
Because that's the example given by Mike...
Who doesn't love writing other than Walter Bright:
[...]
Who are you saying said it's
On Tuesday, 25 April 2023 at 18:38:14 UTC, max haughton wrote:
On Tuesday, 25 April 2023 at 04:54:43 UTC, Mike Parker wrote:
Firstly I think this is the correct decision, certainly for
now, probably forever.
Regarding enums in switch statements, Walter suggested we
could shorten the `with
On Tuesday, 25 April 2023 at 04:54:43 UTC, Mike Parker wrote:
I submitted DIP1044, "Enum Type Inference", to Walter and Atila
on April 1. I received the final decision from them on April
18. They have decided not to accept this proposal.
[snip]
I didn't follow this too closely last year,
On Tuesday, 25 April 2023 at 04:54:43 UTC, Mike Parker wrote:
Firstly I think this is the correct decision, certainly for now,
probably forever.
Regarding enums in switch statements, Walter suggested we could
shorten the `with final switch` syntax such that the `with` is
implicitly applied
On Tuesday, 25 April 2023 at 04:54:43 UTC, Mike Parker wrote:
I submitted DIP1044, "Enum Type Inference", to Walter and Atila
on April 1. I received the final decision from them on April
18. They have decided not to accept this proposal.
IMO this is the correct decision. While a feature like
On Tuesday, 25 April 2023 at 04:54:43 UTC, Mike Parker wrote:
I submitted DIP1044, "Enum Type Inference", to Walter and Atila
on April 1. I received the final decision from them on April
18. They have decided not to accept this proposal.
This is not good news :-|
On Tuesday, 25 April 2023 at 04:54:43 UTC, Mike Parker wrote:
I submitted DIP1044, "Enum Type Inference", to Walter and Atila
on April 1. I received the final decision from them on April
18. They have decided not to accept this proposal.
That DIP sure became a bikeshed at the last review.
On Tuesday, 25 April 2023 at 06:41:04 UTC, zjh wrote:
Is it okay to use a new keyword `enumswitch` that is equivalent
to `with final switch`?
If there were an `official restriction` that could simplify `long
keywords`, that would be great,like:
```d
alias keyword enumswitch=with final
On Tuesday, 25 April 2023 at 04:54:43 UTC, Mike Parker wrote:
..
Is it okay to use a new keyword `enumswitch` that is equivalent
to `with final switch`?
On Tuesday, 25 April 2023 at 04:54:43 UTC, Mike Parker wrote:
I submitted DIP1044, "Enum Type Inference", to Walter and Atila
on April 1. I received the final decision from them on April
18. They have decided not to accept this proposal.
I submitted DIP1044, "Enum Type Inference", to Walter and Atila
on April 1. I received the final decision from them on April 18.
They have decided not to accept this proposal.
https://github.com/dlang/DIPs/blob/master/DIPs/rejected/DIP1044.md
The said the proposal was well done and an
52 matches
Mail list logo