what's the semantics of 'varX is varY', in particular `strX is strY`?
Adam D. Ruppe
destructionator at gmail.com
Wed Aug 5 17:33:19 UTC 2020
On Wednesday, 5 August 2020 at 17:29:09 UTC, mw wrote:
> so here `is` means compare strings by their contents?
They both refer to the same string there... the literal gets
reused by the compiler. Put a .dup on one of the strings and then
is will not return true anymore.
> where is the exact definition of the semantics of 'varX is
> varY'?
It checks if the memory for the variable is the same.
More information about the Digitalmars-d
mailing list