digitalmars.D - :end to terminate attribute:
- Mike Parker (2/2) Sep 28 2016 Given
- Mike Parker (25/25) Sep 28 2016 Let's try this again.
- ZombineDev (14/40) Sep 28 2016 AFAIR, last year or so, Andrei approved the proposal for
- ZombineDev (9/24) Sep 28 2016 I meant:
- Mike Parker (3/5) Sep 28 2016 Yeah, that's what I couldn't remember. I'll dig up the discussion
- Seb (5/7) Sep 28 2016 These two DIPs drafts also try to tackle the attribute problem:
- Andrei Alexandrescu (4/9) Sep 28 2016 Yah, we've got to have something. There's been quibbles over syntax but
Let's try this again.
This attribute block can be terminated by a corresponding
protection attribute block:
// Begin private
private:
void foo() {}
// End private
public:
void bar() {}
But not all attributes have a corresponding attribute to turn
them off:
// Begin nogc
nogc:
...
// End with scope/file
It would be a nice convenience to have something like this:
nogc:
:end
Yes, I'm aware I could do this:
nogc {}
But given the choice of : and {}, I'm tending to prefer the
former these days. The lack of a way to turn off some attributes
forces me to use {}. I recall discussions about something like
nogc(off) or some such. Was that ever approved? If not, I'd love
to have something like :end, though I'm not attached to the name.
Sep 28 2016
On Wednesday, 28 September 2016 at 09:43:38 UTC, Mike Parker
wrote:
Let's try this again.
This attribute block can be terminated by a corresponding
protection attribute block:
// Begin private
private:
void foo() {}
// End private
public:
void bar() {}
But not all attributes have a corresponding attribute to turn
them off:
// Begin nogc
nogc:
...
// End with scope/file
It would be a nice convenience to have something like this:
nogc:
:end
Yes, I'm aware I could do this:
nogc {}
But given the choice of : and {}, I'm tending to prefer the
former these days. The lack of a way to turn off some
attributes forces me to use {}. I recall discussions about
something like nogc(off) or some such. Was that ever approved?
If not, I'd love to have something like :end, though I'm not
attached to the name.
AFAIR, last year or so, Andrei approved the proposal for
attr(bool expr), eg:
nogc:
// no gc code here
nogc(false):
// code that's allowed to use the gc here
class Base(bool overridableImpl)
{
final:
final(overridableImpl) void impl() { /* ... */
}
But still no one has stepped in to do the implementation.
Sep 28 2016
On Wednesday, 28 September 2016 at 09:48:27 UTC, ZombineDev wrote:On Wednesday, 28 September 2016 at 09:43:38 UTC, Mike Parker wrote:I meant: class Base(bool overridableImpl) { final: /* final methods here */ final(!overridableImpl) void impl() { /* ... */ } /* final methods here */ }[...]AFAIR, last year or so, Andrei approved the proposal for attr(bool expr), eg: nogc: // no gc code here nogc(false): // code that's allowed to use the gc here class Base(bool overridableImpl) { final: final(overridableImpl) void impl() { /* ... */ } But still no one has stepped in to do the implementation.
Sep 28 2016
On Wednesday, 28 September 2016 at 09:48:27 UTC, ZombineDev wrote:AFAIR, last year or so, Andrei approved the proposal for attr(bool expr), eg:Yeah, that's what I couldn't remember. I'll dig up the discussion read up on it again.
Sep 28 2016
On Wednesday, 28 September 2016 at 10:14:25 UTC, Mike Parker wrote:Yeah, that's what I couldn't remember. I'll dig up the discussion read up on it again.These two DIPs drafts also try to tackle the attribute problem: http://wiki.dlang.org/DIP64 http://wiki.dlang.org/DIP79
Sep 28 2016
On 9/28/16 11:48 AM, ZombineDev wrote:AFAIR, last year or so, Andrei approved the proposal for attr(bool expr), eg: nogc: // no gc code here nogc(false):Yah, we've got to have something. There's been quibbles over syntax but nothing better came up that is as comprehensive. nogc(true) and generally nogc(ctBoolean) should work as well. -- Andrei
Sep 28 2016









ZombineDev <petar.p.kirov gmail.com> 