What's missing from Phobos for Orbit (package manager)
Jacob Carlborg
doob at me.com
Thu Feb 14 12:01:36 PST 2013
On 2013-02-14 13:42, Andrei Alexandrescu wrote:
> I understand. Adding functions such as the negation of empty becomes a
> judgment call.
>
> Phobos does have quite a few simple functions that could be easily
> achieved through expression composition (e.g. trim) or statement
> composition (e.g. enforce). So again it's all a matter of judgment.
>
> Walter and I don't consider the negation of empty as useful enough to
> receive a name.
How about this, I have another similar function that might be useful in
Phobos as well.
"isBlank" and "isPresent". "isPresent" is just the opposite of "isBlank".
"isBlank" works like this:
* If it's a string - it's considered blank if it's empty or only
contains white space
* If you can call "empty" on it - return the result
* If it's a reference type and it's null - return true
* Otherwise return false
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list