Re: Revert attributes to their defaults with default keywords

2015-01-09 Thread ketmar via Digitalmars-d
On Sat, 10 Jan 2015 02:47:00 + Meta via Digitalmars-d wrote: > On Friday, 9 January 2015 at 14:26:26 UTC, aldanor wrote: > > It could work both ways at the same time. > > > > Maybe even something like "default(pred) final(pred) nothrow" > > --> if pred is compile-time-true, reset all attribu

Re: Revert attributes to their defaults with default keywords

2015-01-09 Thread Meta via Digitalmars-d
On Friday, 9 January 2015 at 14:26:26 UTC, aldanor wrote: It could work both ways at the same time. Maybe even something like "default(pred) final(pred) nothrow" --> if pred is compile-time-true, reset all attributes and then add final/nothrow; if it's compile-time-false, disable final and en

Re: Revert attributes to their defaults with default keywords

2015-01-09 Thread aldanor via Digitalmars-d
On Friday, 9 January 2015 at 13:01:14 UTC, Steven Schveighoffer wrote: On 1/9/15 7:47 AM, Daniel Kozák via Digitalmars-d wrote: V Fri, 09 Jan 2015 07:21:02 -0500 Steven Schveighoffer via Digitalmars-d napsáno: On 1/9/15 6:57 AM, Daniel Kozak wrote: I often have code like this: class A {

Re: Revert attributes to their defaults with default keywords

2015-01-09 Thread Steven Schveighoffer via Digitalmars-d
On 1/9/15 7:47 AM, Daniel Kozák via Digitalmars-d wrote: V Fri, 09 Jan 2015 07:21:02 -0500 Steven Schveighoffer via Digitalmars-d napsáno: On 1/9/15 6:57 AM, Daniel Kozak wrote: I often have code like this: class A { final: nothrow: ... some methods ... } Probl

Re: Revert attributes to their defaults with default keywords

2015-01-09 Thread Daniel Kozák via Digitalmars-d
V Fri, 09 Jan 2015 07:21:02 -0500 Steven Schveighoffer via Digitalmars-d napsáno: > On 1/9/15 6:57 AM, Daniel Kozak wrote: > > I often have code like this: > > > > class A { > > final: > > nothrow: > > ... > > some methods > > ... > > } > > > > Problem comes when I need a

Re: Revert attributes to their defaults with default keywords

2015-01-09 Thread Steven Schveighoffer via Digitalmars-d
On 1/9/15 6:57 AM, Daniel Kozak wrote: I often have code like this: class A { final: nothrow: ... some methods ... } Problem comes when I need add methods which for eg.: throws or need to be virtual. I can put them before final: but this is not perfect, because I prefe

Re: Revert attributes to their defaults with default keywords

2015-01-09 Thread ketmar via Digitalmars-d
On Fri, 9 Jan 2015 13:16:48 +0100 Daniel Kozák via Digitalmars-d wrote: > V Fri, 9 Jan 2015 14:11:00 +0200 > ketmar via Digitalmars-d napsáno: > > > can it be used like this: > > > > final: > > nothrow: > > ... > > default void foo () { ... } > > ... > > > > so only `foo` beco

Re: Revert attributes to their defaults with default keywords

2015-01-09 Thread Daniel Kozák via Digitalmars-d
V Fri, 9 Jan 2015 14:11:00 +0200 ketmar via Digitalmars-d napsáno: > can it be used like this: > > final: > nothrow: > ... > default void foo () { ... } > ... > > so only `foo` becomes default, but all other methods after `foo` are > `final nothrow`? not now, but I plan add thi

Re: Revert attributes to their defaults with default keywords

2015-01-09 Thread ketmar via Digitalmars-d
On Fri, 09 Jan 2015 11:57:50 + Daniel Kozak via Digitalmars-d wrote: > I often have code like this: > > class A { > final: > nothrow: > ... > some methods > ... > } > > Problem comes when I need add methods which for eg.: throws or > need to be virtual. > > I can

Revert attributes to their defaults with default keywords

2015-01-09 Thread Daniel Kozak via Digitalmars-d
I often have code like this: class A { final: nothrow: ... some methods ... } Problem comes when I need add methods which for eg.: throws or need to be virtual. I can put them before final: but this is not perfect, because I prefer when methods are place in specific order