June 09, 2019
On Sunday, 9 June 2019 at 08:05:34 UTC, Manu wrote:
> I am really really tired of this pattern:
>
> struct DerivedStruct
> {
>     static if (BaseStruct.tupleof.length > 0)
>         BaseStruct base;
>     else
>         ref inout(BaseStruct) base() inout { return
> *cast(inout(BaseStruct)*)&this; }
>     alias base this;
>
>     // derived members
>     //...
> }
>
> Imagine if we could just write:
>
> struct DerivedStruct : BaseStruct
> {
>     // derived members
>     //...
> }
>
> Just imagine!

You can just put the boiler plate code in a mixin template.

mixin template  BaseAs(T) {
    static if(T.tupleof.length > 0) T base;
    else                            ref inout(T) base() inout { return *cast(inout(T)*)&this; }

    alias base this;
}

struct DerivedStruct {
    mixin BaseAs!BaseStruct;
}

June 09, 2019
On Sunday, 9 June 2019 at 08:05:34 UTC, Manu wrote:
> I am really really tired of this pattern:
>
> struct DerivedStruct
> {
>     static if (BaseStruct.tupleof.length > 0)
>         BaseStruct base;
>     else
>         ref inout(BaseStruct) base() inout { return
> *cast(inout(BaseStruct)*)&this; }
>     alias base this;
>
>     // derived members
>     //...
> }
>
> Imagine if we could just write:
>
> struct DerivedStruct : BaseStruct
> {
>     // derived members
>     //...
> }
>
> Just imagine!

What is wrong with alias this?
June 09, 2019
On Sunday, 9 June 2019 at 16:45:18 UTC, 12345swordy wrote:

> What is wrong with alias this?

in my mind "alias this" is a crutch that allow to move on, that tries to replace "has-a" with "is-a" and at the same time introduces an implicit conversion operator. last one can be alone: decimal to double with no inheritance.

in your my its cool thing and "let me sign your cast".

well, just two different points of view at one thing.
BUT in case where I want "is-a" from one type and implicit cast to another my point became more correct. BUT I can't think of an example right now, maybe no such example at all. BUT I still has more control in my hands with is-a/has-a and implicit opCast(if it will be added).
June 09, 2019
On Sunday, 9 June 2019 at 17:09:44 UTC, KnightMare wrote:
> in your my its cool thing and "let me sign your cast".
*your mind this is cool thing*

PS need to allow edit post for 5min at at least

June 09, 2019
On Sunday, 9 June 2019 at 17:11:37 UTC, KnightMare wrote:
> On Sunday, 9 June 2019 at 17:09:44 UTC, KnightMare wrote:
>> in your my its cool thing and "let me sign your cast".
> *your mind this is cool thing*
>
> PS need to allow edit post for 5min at at least

Or you can:

1) Revise it better before posting.

2) If you use e-mail instead of WEB Front-End, some e-mail services and applications (Like Thunderbird) allows you to hold it for some time before sending.
June 09, 2019
On Sunday, 9 June 2019 at 17:26:40 UTC, SashaGreat wrote:

>> PS need to allow edit post for 5min at at least
>
> Or you can:
>
> 1) Revise it better before posting.
>
> 2) If you use e-mail instead of WEB Front-End, some e-mail services and applications (Like Thunderbird) allows you to hold it for some time before sending.

people make mistakes that can't be changed.
1) please dont write AI for people control system :)
2) too complicated.
my suggestion (allow to edit post in next 5mins) is more humane.
June 09, 2019
On Sunday, June 9, 2019 11:35:28 AM MDT KnightMare via Digitalmars-d wrote:
> On Sunday, 9 June 2019 at 17:26:40 UTC, SashaGreat wrote:
> >> PS need to allow edit post for 5min at at least
> >
> > Or you can:
> >
> > 1) Revise it better before posting.
> >
> > 2) If you use e-mail instead of WEB Front-End, some e-mail services and applications (Like Thunderbird) allows you to hold it for some time before sending.
>
> people make mistakes that can't be changed.
> 1) please dont write AI for people control system :)
> 2) too complicated.
> my suggestion (allow to edit post in next 5mins) is more humane.

This is a newsgroup which can also be accessed via a web interface and via a mailing list. Once a message has been sent, it's been sent. It immediately goes out to everyone over the various interfaces, and it wouldn't make any more sense to try to edit your message after sending it than it would to try to edit an e-mail after you sent it to hundreds of people.

- Jonathan M Davis



June 09, 2019
On Sunday, 9 June 2019 at 17:57:05 UTC, Jonathan M Davis wrote:
> On Sunday, June 9, 2019 11:35:28 AM MDT KnightMare via Digitalmars-d wrote:
>> On Sunday, 9 June 2019 at 17:26:40 UTC, SashaGreat wrote:
>> >> PS need to allow edit post for 5min at at least
>> >
>> > Or you can:
>> >
>> > 1) Revise it better before posting.
>> >
>> > 2) If you use e-mail instead of WEB Front-End, some e-mail services and applications (Like Thunderbird) allows you to hold it for some time before sending.
>>
>> people make mistakes that can't be changed.
>> 1) please dont write AI for people control system :)
>> 2) too complicated.
>> my suggestion (allow to edit post in next 5mins) is more humane.
>
> This is a newsgroup which can also be accessed via a web interface and via a mailing list. Once a message has been sent, it's been sent. It immediately goes out to everyone over the various interfaces, and it wouldn't make any more sense to try to edit your message after sending it than it would to try to edit an e-mail after you sent it to hundreds of people.
>
> - Jonathan M Davis

Github also sends messages via email, you can even make replies by email. You can still edit them afterwards though.
June 09, 2019
On Sunday, June 9, 2019 12:19:34 PM MDT Exil via Digitalmars-d wrote:
> On Sunday, 9 June 2019 at 17:57:05 UTC, Jonathan M Davis wrote:
> > On Sunday, June 9, 2019 11:35:28 AM MDT KnightMare via
> >
> > Digitalmars-d wrote:
> >> On Sunday, 9 June 2019 at 17:26:40 UTC, SashaGreat wrote:
> >> >> PS need to allow edit post for 5min at at least
> >> >
> >> > Or you can:
> >> >
> >> > 1) Revise it better before posting.
> >> >
> >> > 2) If you use e-mail instead of WEB Front-End, some e-mail services and applications (Like Thunderbird) allows you to hold it for some time before sending.
> >>
> >> people make mistakes that can't be changed.
> >> 1) please dont write AI for people control system :)
> >> 2) too complicated.
> >> my suggestion (allow to edit post in next 5mins) is more
> >> humane.
> >
> > This is a newsgroup which can also be accessed via a web interface and via a mailing list. Once a message has been sent, it's been sent. It immediately goes out to everyone over the various interfaces, and it wouldn't make any more sense to try to edit your message after sending it than it would to try to edit an e-mail after you sent it to hundreds of people.
> >
> > - Jonathan M Davis
>
> Github also sends messages via email, you can even make replies by email. You can still edit them afterwards though.

But no one gets those updates without looking at github, and even if they did, it would have to be via a new e-mail, cluttering things up. It's not possible for anyone to edit their message on github and then have the e-mails that everyone received update. The e-mails from github serve as notifications of what's on the website, not as the primary means of communication.

And for D, the web interface is _not_ what controls the data. It's a client just like my e-mail client is and just like Walter's newsgroup client is. So, all it can edit is its local cache, which would make it out-of-sync with everyone else. Or it could send out a second message - which is exactly what you have to do right now. And because that's what you have to do, it doesn't give the false impression that you can edit previously sent messages.

- Jonathan M Davis



June 09, 2019
On Sunday, 9 June 2019 at 18:43:01 UTC, Jonathan M Davis wrote:
> On Sunday, June 9, 2019 12:19:34 PM MDT Exil via Digitalmars-d wrote:
>> On Sunday, 9 June 2019 at 17:57:05 UTC, Jonathan M Davis wrote:
>> > On Sunday, June 9, 2019 11:35:28 AM MDT KnightMare via
>> >
>> > Digitalmars-d wrote:
>> >> On Sunday, 9 June 2019 at 17:26:40 UTC, SashaGreat wrote:
>> >> >> PS need to allow edit post for 5min at at least
>> >> >
>> >> > Or you can:
>> >> >
>> >> > 1) Revise it better before posting.
>> >> >
>> >> > 2) If you use e-mail instead of WEB Front-End, some e-mail services and applications (Like Thunderbird) allows you to hold it for some time before sending.
>> >>
>> >> people make mistakes that can't be changed.
>> >> 1) please dont write AI for people control system :)
>> >> 2) too complicated.
>> >> my suggestion (allow to edit post in next 5mins) is more
>> >> humane.
>> >
>> > This is a newsgroup which can also be accessed via a web interface and via a mailing list. Once a message has been sent, it's been sent. It immediately goes out to everyone over the various interfaces, and it wouldn't make any more sense to try to edit your message after sending it than it would to try to edit an e-mail after you sent it to hundreds of people.
>> >
>> > - Jonathan M Davis
>>
>> Github also sends messages via email, you can even make replies by email. You can still edit them afterwards though.
>
> But no one gets those updates without looking at github, and even if they did, it would have to be via a new e-mail, cluttering things up. It's not possible for anyone to edit their message on github and then have the e-mails that everyone received update. The e-mails from github serve as notifications of what's on the website, not as the primary means of communication.

That's because emails aren't suited for this type of communication. If you want to use emails, then yes you would then receive a second email. But if someone needs to make a correction anyways, they will need to send a second email as well. This not only clutters up the email but also the website as well. Which is what we have now.

> And for D, the web interface is _not_ what controls the data. It's a client just like my e-mail client is and just like Walter's newsgroup client is. So, all it can edit is its local cache, which would make it out-of-sync with everyone else. Or it could send out a second message - which is exactly what you have to do right now. And because that's what you have to do, it doesn't give the false impression that you can edit previously sent messages.
>
> - Jonathan M Davis

And? This is set in stone? There's no way to implement something better?