May 27, 2022

On Friday, 27 May 2022 at 14:46:47 UTC, user1234 wrote:

>

while D has static foreach, which can be similarly used let's say to unroll += on each member of a tuple.

I always say that d should learn c++.
Add as much as you need .
When 'c++' users get used to 'c++'s ... .D should add it.
Don't be afraid of increasing complexity. Programming is a game of intelligence.
D should be configuriable like 'VIM'. And give you what you like,everything is here for you to choose.

Your target users are mainly excellent 'c++' user groups. As for 'rust', they are mainly atract people who can't learn 'c++' well . Excellent 'c++' users will not turn to 'rust'.

If you satisfy 'c++' users, they will come.
At least I have what others have.

And also ... and arrays are orthogonal.
They are different concepts. C++'s folding expressions can match many operators.It's so convenient.

May 27, 2022

On Friday, 27 May 2022 at 15:13:55 UTC, zjh wrote:

The ... accompanying sequence index is very powerful!
All sorts of strange skills .
This is not a simple tuple or static foreach can match.It's too powerful.

May 27, 2022

On Friday, 27 May 2022 at 15:13:55 UTC, zjh wrote:

>

On Friday, 27 May 2022 at 14:46:47 UTC, user1234 wrote:

>

while D has static foreach, which can be similarly used let's say to unroll += on each member of a tuple.

I always say that d should learn c++.
Add as much as you need .
When 'c++' users get used to 'c++'s ... .D should add it.
Don't be afraid of increasing complexity. Programming is a game of intelligence.
D should be configuriable like 'VIM'. And give you what you like,everything is here for you to choose.

Your target users are mainly excellent 'c++' user groups. As for 'rust', they are mainly atract people who can't learn 'c++' well . Excellent 'c++' users will not turn to 'rust'.

If you satisfy 'c++' users, they will come.
At least I have what others have.

And also ... and arrays are orthogonal.
They are different concepts. C++'s folding expressions can match many operators.It's so convenient.

yes this is bit what I had in mind, that looks like a very specific unrolled operation that c++ can only handle with '...' So C++ can handle 32 operators with "..." but D has not limit, although the syntax is a bit less friendly.

For example what if the tuple contains a value whose type is not compatible with one of the 32 operators ? You see in D you can handle that in a static condition.

May 27, 2022

On Friday, 27 May 2022 at 15:21:20 UTC, zjh wrote:

>

On Friday, 27 May 2022 at 15:13:55 UTC, zjh wrote:

The ... accompanying sequence index is very powerful!
All sorts of strange skills .
This is not a simple tuple or static foreach can match.It's too powerful.

The D equivalent of C++ ... is staticMap from std.meta.

May 27, 2022

On Friday, 27 May 2022 at 16:30:33 UTC, Paul Backus wrote:

>

On Friday, 27 May 2022 at 15:21:20 UTC, zjh wrote:

>

On Friday, 27 May 2022 at 15:13:55 UTC, zjh wrote:

The ... accompanying sequence index is very powerful!
All sorts of strange skills .
This is not a simple tuple or static foreach can match.It's too powerful.

The D equivalent of C++ ... is staticMap from std.meta.

You can do more than just map, you'd probably have to include more helper types to get the same behavior. Which should really be built into the language, which is what C++ did.

May 27, 2022

On Friday, 27 May 2022 at 16:30:33 UTC, Paul Backus wrote:

>

On Friday, 27 May 2022 at 15:21:20 UTC, zjh wrote:

>

On Friday, 27 May 2022 at 15:13:55 UTC, zjh wrote:

The ... accompanying sequence index is very powerful!
All sorts of strange skills .
This is not a simple tuple or static foreach can match.It's too powerful.

The D equivalent of C++ ... is [staticMap][1] from std.meta.

Zjh is talking about builtin functional style fold expressions applied to parameter packs and std:: integer_sequence.

It can be very convenient for summing sizes etc, but I have found the use cases to be limited in real code.

maybe zjh could show some examples?

May 27, 2022

On Friday, 27 May 2022 at 16:15:53 UTC, user1234 wrote:

>

that looks like a very specific unrolled operation that c++ can only handle with '...'

It is just syntax sugar, you can handle it with recursion in C++ as well. There was no real need for it.

May 27, 2022

On Friday, 27 May 2022 at 10:07:53 UTC, zjh wrote:

>

On Friday, 27 May 2022 at 09:37:25 UTC, zjh wrote:
I hope that the d language can better link to my

>

previous C++ library.

I also hope that d can have ... operator.
It turns out that 'manu' has a 'dip', which is obviously a good thing. Why not add it?
D need to learn 'c++''s success.Add when you should.As long as no use, no cost. Then who cares.
As for d's becoming complex , which successful language is not complex in the end?
I just hope that I can configure like 'vim',Everything is configurable.

Stop adding new crap int he language, unless it fixes existing crap. Once the existing crap is in decent shape, we'll think about .... Endless pursuing the next shinny object- is how we got where we are.

Even in this thread, this keeps happening. It's like an addition.

May 28, 2022

On Friday, 27 May 2022 at 16:30:33 UTC, Paul Backus wrote:

>

The D equivalent of C++ ... is [staticMap][1] from std.meta.

and to user1234,like this etc:

template<int K,int M,class F,int...J,class...T>
void gg(F&f,seq<J...>,T&...t){
    (hh(f,G<K,M,J>(),t...),...);
}

... means combat effectiveness and productivity.

May 28, 2022

On Friday, 27 May 2022 at 16:42:26 UTC, mee6 wrote:

>

Which should really be built into the language, which is what C++ did.

Right!