G’day:
Micha suggested I transfer this point from Jira to here. I pretty much think we were discussing the resolution (or, in this case: lack of resolution) of a bug, but… well… so be it.
Anyhow, In Lucee exceptions are objects (CatchBlockImpl), but mostly behave like structs. They do not, however, pass the isObject() test. And whilst one can call structKeyExists() on them, one cannot call keyExists() (a different issue, and on that I believe is resolved at least in Lucee 4.5: LDEV-322)
Micha contends they ought to just behave like structs, whereas I think Exceptions are always objects, and that’s what they should stay. If they also want to implement whatever interface is required to make them pass as structs: yeah, cool, knock yourself out. But they’re still some manner of Exception object (ultimately extending java.lang.Exception).
I hasten to add this is a fairly inconsequential issue, but I always get a bit itchy when I see “weirdness” in a language, so it got me thinking. I’m all for necessary unexpected behaviour, but I’m less enthused about unexpected behaviour that doesn’t seem to have a good rationale beyond an implementation / design glitch.
Thoughts?
–
Adam