Is str ~ regex the root of all evil, or the leaf of all good?
Daniel Keep
daniel.keep.lists at gmail.com
Thu Feb 19 07:17:15 PST 2009
bearophile wrote:
> Simen Kjaeraas:
>> auto re = regex("a[b-e]", "g");
>> foreach (e; "abracazoo" / re) {
>> }
>
> D has operator overload, that Java lacks, but this fact doesn't force you to use them even when they are unreadable.
>
> For people that like the "in" there I'd like to remind how it can look once (if it will ever happen) the foreach uses "in" too:
>
> foreach (e in (re in "abracazoo")) {...}
>
> Bye,
> bearophile
But it doesn't, and I can't see how it could given how confusing it
would make things. Besides which, we shouldn't be making judgements
based on possible, not planned for syntax changes at some unspecified
point in the future.
We have enough trouble with deciding on things as it is. :P
-- Daniel
More information about the Digitalmars-d
mailing list