October 19, 2022
On Wednesday, 19 October 2022 at 01:34:54 UTC, mw wrote:
> Is there any (design) doc about this?

scroll up, click the link from this very thread.

https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1038.md#design-goals-and-possible-alternatives

October 19, 2022
On Wednesday, 19 October 2022 at 01:38:27 UTC, Adam D Ruppe wrote:
> On Wednesday, 19 October 2022 at 01:34:54 UTC, mw wrote:
>> Is there any (design) doc about this?
>
> scroll up, click the link from this very thread.
>
> https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1038.md#design-goals-and-possible-alternatives

"""
Rather than make either sacrifice, this DIP proposes a design that allows both rigor and simplicity to be maintained, and reserves the possibility for a future DIP to allow @mustUse as a function attribute.
"""

Another future DIP? I think this DIP is flawed for not using "@mustUse as a function attribute"

October 19, 2022
On Wednesday, 19 October 2022 at 01:49:26 UTC, mw wrote:
> On Wednesday, 19 October 2022 at 01:38:27 UTC, Adam D Ruppe wrote:
>> On Wednesday, 19 October 2022 at 01:34:54 UTC, mw wrote:
>>> Is there any (design) doc about this?
>>
>> scroll up, click the link from this very thread.
>>
>> https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1038.md#design-goals-and-possible-alternatives
>
> """
> Rather than make either sacrifice, this DIP proposes a design that allows both rigor and simplicity to be maintained, and reserves the possibility for a future DIP to allow @mustUse as a function attribute.
> """
>
> Another future DIP? I think this DIP is flawed for not using "@mustUse as a function attribute"

@mustuse as a function attribute was in the original version of the DIP. It was vetoed by Walter. Thus, only the type attribute remains in the accepted version.

FWIW, this is the same path that #[must_use] took in Rust. It was added originally as a type attribute only, and later had its usage extended to functions.
October 19, 2022
On Wednesday, 19 October 2022 at 01:34:54 UTC, mw wrote:
> On Wednesday, 19 October 2022 at 01:30:23 UTC, H. S. Teoh wrote:
>> On Wed, Oct 19, 2022 at 01:15:37AM +0000, Adam D Ruppe via
>>> 
>>> it only applies to types, not to functions.
>>
>> Wat... so what's the use of it then?  So it's not possible to mark the return value of an int function @mustUse without making, in theory, *all* ints @mustUse?
>>
>> I must confess I'm baffled as to the purpose of this strange design.
>>
>
> Same, can't believe it.
>
> Is there any (design) doc about this?

It's right there in the summary of the Final Review of the DIP that I linked above:

https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1038.md#final-review
October 19, 2022
On Wednesday, 19 October 2022 at 03:10:29 UTC, Mike Parker wrote:

>
> It's right there in the summary of the Final Review of the DIP that I linked above:
>
> https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1038.md#final-review

I meant to say the summary of the formal assessment. One of the conditions of acceptance was this one:

> develop rules for handling covariance and contravariance when applied to functions.

Paul opted instead to do just have it apply to types for now. A future enhancement can take on extending it to functions. As he noted above, that's the approach Rust took as well.
October 19, 2022
> @mustuse as a function attribute was in the original version of the DIP. It was vetoed by Walter. Thus, only the type attribute remains in the accepted version.

Let's continue the discussion here:

https://forum.dlang.org/thread/nmornkxaxddfziqmqqld@forum.dlang.org

in general, it's about: command query separation principle
October 19, 2022

On Wednesday, 19 October 2022 at 04:59:40 UTC, mw wrote:

>

...

Why can't do it in one step?
Why always afraid to add features?
C++ is so complicated ,but that people are not afraid to continue to add features.

October 19, 2022

On Wednesday, 19 October 2022 at 05:41:26 UTC, zjh wrote:

>

Why can't do it in one step?
Why always afraid to add features?
C++ is so complicated ,but that people are not afraid to continue to add features.

There is also class level private. I saw someone start it by himself, and he felt very happy. It completely conforms to the encapsulation, but it seems that the latest D has no switch about it.
In my opinion, as long as users have reasonable needs, languages should added corresponding features, instead of becoming religions.

Some features are very popular for users,I really don't know why they didn't add it.

October 19, 2022

On Wednesday, 19 October 2022 at 05:50:18 UTC, zjh wrote:

>

In my opinion, as long as users have reasonable needs, languages should added corresponding features, instead of becoming religions.

Some features are very popular for users,I really don't know why they didn't add it.

When you show prejudice, users are lost.
Like class, when it can be used as the smallest encapsulation unit, it can provide this feature but intentionally does not.

Just like when you ride a bicycle, but it has a square tire.

October 19, 2022

On Wednesday, 19 October 2022 at 05:41:26 UTC, zjh wrote:

>

Why always afraid to add features?
C++ is so complicated ,but that people are not afraid to continue to add features.

Look at the emerging languages, which are not crazy about adding features. Even go is adding generics.

1 2
Next ›   Last »