Simultaneous Assignment
Dfr
deflexor at yandex.ru
Mon Dec 9 01:32:25 PST 2013
Sorry, it was misnomer in topic title. But simultaneous
assignment also useful topic to learn.
What i trying to achieve in my current example is more succinct
code.
A coming from Perl and instead of writing:
if(some_complex_statement.here > 0) {
writefln("x is %s", some_long_expression.here);
}
I got used not to repeat complex statement, but use 'x' as quick
alias:
if((int x = some_complex_statement.here) > 0) {
writefln("x is %s", x);
}
On Monday, 9 December 2013 at 08:28:48 UTC, qznc wrote:
>
> Could you give more context for your specific example? What are
> you trying to do?
More information about the Digitalmars-d-learn
mailing list