between and among: worth Phobosization?

Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com> Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com>
Tue Dec 17 10:48:57 PST 2013


On Tuesday, 17 December 2013 at 18:16:59 UTC, Andrei Alexandrescu 
wrote:

> if (foo in LiteralSet("alpha", "beta", "delta"))

if "_" referred to anything undefined then you could do:

if (foo in ["alpha":_,"beta":_,"delta":_])

Side-note: LLVM actually uses a value "undef" that it uses for 
reasoning, so that

(x & undef) == 0
(x | undef) == -1

Kind of cute.

Or even better:

if (foo in ["alpha":-),"beta":-),"delta":-)])


More information about the Digitalmars-d mailing list