Proposal: isComplexValue() decision function

I’m not sure about anyone else, but I often have code that has this conditional check:

if ( ! isSimpleValue( value ) ) {
    return( true );
}

My brain is tired of reading the “IS NOT” style condition. I would love to have an isComplexValue() decision function so that I could turn these conditions into:

if ( isComplexValue( value ) ) {
    return( true );
}

I know there is an isObject() function, but that pertains to Java objects only.

5 Likes

+1 for also introducing the isSimpleValue() that I might have read somewhere, but got somehow into the backyard obscure part of my brain :smiley:

Ha ha, my pleasure. There’s a load of “decision” functions in the language. Good little utilities to have in the back of your brain.

Honestly, I think we could make them both a little more verbose…

isComplexVariableValue() just rolls off the tongue better than isComplex()

but perhaps I just need my second coffee

You may need coffee, only because we called it isComplexValue(), not isComplex(), which I agree would be overly-terse :wink:

Not sure if that isntComplicatedEnough()

Well, it isntNotNOTComplicatedEnough()…

+1 for isComplexValue() :coffee:

1 Like

Docs say otherwise?

The docs say:

False if the value is any other type of data, such as an integer, string, date, or struct

It’s good up until that last one, Struct.

1 Like