typeof(SortedRange) and is operator

Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Nov 8 15:01:16 PST 2016


On Tuesday, November 08, 2016 22:33:08 Era Scarecrow via Digitalmars-d-learn 
wrote:
> On Tuesday, 8 November 2016 at 21:14:41 UTC, Jonathan M Davis
>
> wrote:
> > No, as the others have point out, it's not a bug. If anything
> > it's a language design flaw that no one has figured out how to
> > resolve yet.
>
>   The idea of a special struct for code that strips whitespace
> out, or a function that simply does the same thing... Either way
> it would have to be voluntary, preferably at the function level
> writing and not the user level.
>
>   StringNWS? (No White Space) or StringCode?
>
>   Might be something to try... Having a function to call that
> strips it would probably add too much overhead and ugliness
> required by users using the code vs code clarity.
>
>   I'll have to experiment with this later.

The problem is that you can't strip out all whitespace. Some of it matters,
and unless you do something like parse the code in the string, you can't
know whether the whitespace matters or not. Ultimately, it's just easier to
write your strings the same way, which usually is trivial.

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list