[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[HTCondor-users] class ad logic with undef (non-)equal

Hi all,

a short `undef` logic question:

I wrote a statement like
  ( Expr1 || regexp('strfoo',MyAdd) ) != true

Unfortunately, I had assumed, that the regexp macro should always resolve to
  ( Expr1 || true/false ) != true
but Kruno pointed out, that in case the ad is undef the macro is not defined as well - which would result in
  undef != true

So, one question would be, if there is a `?`-like operator for a boolean non-equal comparison, that resolves in false when compared to undef?

To catch undef cases, we are going now for
  ( Expr1 || regexp('strfoo',MyAdd) ? : "" ) ) != true
but we are not sure, if `?` as operator actually catches undefs here?


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature