I understand what the “if exists true whose (if true then exists…” construct is for (avoiding errors caused by objects not existing), but I’d like to understand exactly what it’s doing and why it works. Anyone?
For those who might not understand the reference, consider the following two statements, both run on my Windows computer:
Q: exists packages of debianpackages
E: The operator "debianpackages" is not defined.
Q: if exists true whose (if true then exists packages of debianpackages else false) then packages of debianpackages else "<N/A>"
A: <N/A>
The first one fails and the error will stop a relevance statement in its tracks, while the second (cribbing logic from another HCL-authored relevance) sees that such an object does not exist on Windows yet does not error out.
It is not too dissimilar to this structure, where the whose just absorbs the error for the folder non-existence
q: version of file "bob.dll" > "3.0" of folder "notexisting\notexisting" of folder "c:\"
E: Singular expression refers to nonexistent object.
q: exists folder "c:\" whose (version of file "bob.dll" of folder "notexisting\notexisting" of it > "3.0")
A: False