On Mon, Dec 24, 2018 at 04:53:57PM +, Neia Neutuladh via
Digitalmars-d-learn wrote:
> On Mon, 24 Dec 2018 08:16:01 -0800, H. S. Teoh wrote:
> > Rather, it's *conventionally* taken to mean "unused". The language
> > actually does not treat it in any special way apart from "normal"
> >
On Mon, 24 Dec 2018 08:16:01 -0800, H. S. Teoh wrote:
> Rather, it's *conventionally* taken to mean "unused". The language
> actually does not treat it in any special way apart from "normal"
> identifiers. It's perfectly valid (though probably not recommended!) to
> declare functions or
On Mon, Dec 24, 2018 at 02:45:24PM +, bauss via Digitalmars-d-learn wrote:
[...]
> The underscore does nothing and it's just an identifier.
>
> Really it just means "unused". It's frequently used in loops to.
Rather, it's *conventionally* taken to mean "unused". The language
actually does
On Monday, 24 December 2018 at 11:18:44 UTC, Ron Tarrant wrote:
I found a mention that in the definition of a delegate, a
function parameter and its type could be replaced by an
underscore:
myTestRig.addOnDestroy(delegate void(Widget w) { quitApp(); } );
became:
On Monday, 24 December 2018 at 11:30:31 UTC, Johan Engelen wrote:
The underscore is just an identifier but nothing special, it
could be any valid identifier like "ldkhfksdkdsg".
-Johan
Thanks, Johan. In a way, I was hoping it was some kind of
underscore magic. Now my brain hurts.
On Monday, 24 December 2018 at 11:18:44 UTC, Ron Tarrant wrote:
I found a mention that in the definition of a delegate, a
function parameter and its type could be replaced by an
underscore:
myTestRig.addOnDestroy(delegate void(Widget w) { quitApp(); } );
became:
I found a mention that in the definition of a delegate, a
function parameter and its type could be replaced by an
underscore:
myTestRig.addOnDestroy(delegate void(Widget w) { quitApp(); } );
became:
myTestRig.addOnDestroy(delegate void(_) { quitApp(); } );
I was trying to find some further