So what does (inout int = 0) do?
Guillaume Piolat via Digitalmars-d
digitalmars-d at puremagic.com
Mon Apr 18 01:52:19 PDT 2016
On Sunday, 17 April 2016 at 23:03:26 UTC, Adam D. Ruppe wrote:
> On Sunday, 17 April 2016 at 21:20:49 UTC, Timon Gehr wrote:
>> On 17.04.2016 18:44, Nick Treleaven wrote:
>>> I think @property is OK.
>>
>> No, it isn't:
>
>
> Seriously, @property is one of the biggest SNAFUs of the
> language.
>
> I think I'll write an editorial about this stuff in TWID
> tonight. (I'm also very skeptical of the value of pure, @safe,
> nothrow, and @nogc)
As a big user of @nogc, I'd disagree. @nogc is a bit hard to use
and effectively split the language in two, but gives the absolute
confidence that nothing will block.
In audio callbacks and you are supposed to use tryLock and
atomics instead of locking, so allocating is a big problem. And
it's very easy to let something passthrough like a rogue closure
or an array literal.
@nogc is a big safety net I thought wasn't needed, until I had to
make @nogc code.
Personnally I wish synchronized, comma operator, and actively
harmful things would go. nothrow provides little value, but no
negative value.
More information about the Digitalmars-d
mailing list