June 13, 2014 Re: DMD 2.066 Alpha | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kapps | On Friday, 13 June 2014 at 20:52:17 UTC, Kapps wrote:
> On Friday, 13 June 2014 at 20:29:46 UTC, deadalnix wrote:
>> On Friday, 13 June 2014 at 17:12:44 UTC, Steven Schveighoffer
>> wrote:
>>> On Fri, 13 Jun 2014 12:49:32 -0400, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> wrote:
>>>
>>>> Virtual by default will not change. Being able to negate the "final:" label is nice to have but not a must. Adding a keyword for that doesn't scale - it would mean we'd need to add one keyword to undo each label.
>>>
>>> To that end, I thought we were moving towards a more scalable solution: like !final or final!false or final(false), which could be nice for metaprogramming.
>>>
>>> -Steve
>>
>> Yes that was the decision, and with the advantage that the
>> parameter can be computed at compile time.
>
> I honestly don't see this as a noticeable advantage, at least in
> the case of final. Not to mention you could just use "static
> if(dovirtual) { result ~= "final(false)"; }".
That is a plus for generic code, and that work for virtual.
So there is reason to use something specific for virtual.
Consistency is a plus in its own right. Coming up with ad hoc
solution to every problem is an absolutely terrible way to design
a programming language.
|
June 14, 2014 Re: DMD 2.066 Alpha | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Thursday, 12 June 2014 at 18:25:36 UTC, Andrei Alexandrescu wrote: > On 6/12/14, 6:34 AM, Dicebot wrote: >> It was decided and 100% certain - "virtual" is not going in. Need to >> remove it from DMD before this release is out. > > Yes please. -- Andrei Since we didn't seem to have a pull request for removing the attribute: https://github.com/D-Programming-Language/dmd/pull/3663 David |
June 14, 2014 Re: DMD 2.066 Alpha | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Fri, 13 Jun 2014 12:00:39 -0700 Andrei Alexandrescu via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote: > On 6/13/14, 10:15 AM, Nick Sabalausky wrote: > > On 6/13/2014 12:49 PM, Andrei Alexandrescu wrote: > >> > >> Being able to negate the "final:" > >> label is nice to have but not a must. Adding a keyword for that > >> doesn't scale - it would mean we'd need to add one keyword to undo > >> each label. > >> > > > > No it doesn't mean that. "virtual" is very well established industry-wide as the anti-final. Just because we accept that does not mean we can't still do @~pure, @nothrow(false) or whatever for the ones which don't already have well-established names. > > I don't see it necessary to add the "virtual" as a keyword to D. -- If we were going to go with final by default, then adding virtual would make a lot of sense IMHO - especially given that's what people expect from other languages and the fact that virtual would the likely be used far more often than final. Without that however, marking a function as virtual becomes a lot less critical, and it becomes a question of whether the familiarity of using virtual instead of !final or final(false) (or whatever we come up with) is worth adding another keyword and having it in addition to !final or final(false) or whatever (since presumably, we'd still need that for generic code even with virtual). And actually, having virtual would then open the door for !virtual or virtual(false) or whatever in addition to !final or final(false), etc. So, while having virtual would be nice, it's probably complicating things too much from the user's perspective when combined with the ability to explicitly negate attributes. - Jonathan M Davis |
June 15, 2014 Re: DMD 2.066 Alpha | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On 6/14/2014 5:49 PM, Jonathan M Davis via Digitalmars-d-announce wrote:
>
> and it becomes a question of whether the familiarity of using
> virtual instead of !final or final(false) (or whatever we come up with) is
> worth adding another keyword
FWIW, I don't think "virtual" is all that valuable as a user-defined keyword anyway. But, emphasis on "FWIW".
|
June 15, 2014 Re: DMD 2.066 Alpha | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Friday, 13 June 2014 at 16:49:26 UTC, Andrei Alexandrescu wrote:
>
> Virtual by default will not change. Being able to negate the "final:" label is nice to have but not a must. Adding a keyword for that doesn't scale - it would mean we'd need to add one keyword to undo each label.
>
>
> Andrei
Just to try and establish a clear path forwards,
if a pull request existed which added support for...
final!true
final!false
... would it be accepted?
Or would a generic negate-x-DIP be required?
const!false
noexcept!false
etc.
|
June 16, 2014 Re: DMD 2.066 Alpha | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tove | On 6/15/14, 12:30 AM, Tove wrote:
> On Friday, 13 June 2014 at 16:49:26 UTC, Andrei Alexandrescu wrote:
>>
>> Virtual by default will not change. Being able to negate the "final:"
>> label is nice to have but not a must. Adding a keyword for that
>> doesn't scale - it would mean we'd need to add one keyword to undo
>> each label.
>>
>>
>> Andrei
>
> Just to try and establish a clear path forwards,
> if a pull request existed which added support for...
> final!true
> final!false
> .... would it be accepted?
>
> Or would a generic negate-x-DIP be required?
> const!false
> noexcept!false
> etc.
I think we'd need an approved DIP. -- Andrei
|
Copyright © 1999-2021 by the D Language Foundation