D as a prototyping language (for C/C++ projects)

Jacob Carlborg doob at me.com
Wed Feb 27 12:38:31 PST 2013


On 2013-02-27 21:01, Rob T wrote:

> I agree.
>
> I can only see a need for "isPresent" (or the opposite) only if it was
> made clear that isPresent does something different than !isBlank.
>
> If you continue to use isPresent, then I suggest that it is implemented
> as a convenience wrapper around !isBlank to make sure that changes to
> isBlank automatically propagate back to isPresent.

As I said to H.S. Teoh, the question is not about adding the inverse of 
an already existing function. It's about adding functionality that 
doesn't exist. It doesn't matter if isPresent or isBlank would be added.

If you had looked at the code you would see the the implementation of 
isPresent looks like this:

@property bool isPresent (T) (T t)
{
     return !isBlank(t);
}

Which is _exactly_ the inverse of isBlank.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list