IFTE odd behaviour
|
10-11-2019, 08:36 PM
Post: #7
|
|||
|
|||
RE: IFTE odd behaviour
It's a tricky one:
IFTE means IF is_true THEN was_true ELSE was_somethingelse I would expect to either evaluate to was_true if {} is considered true, or was_somethingelse if it is anything other than true. I think {} would fall in the "other than true" category, hence it should return was_somethingelse, or perhaps a list with the result of was_somethingelse inside. Returning 0 doesn't do was_true or was_somethingelse, therefore it's more like this: IF is_true THEN was_true ELSE was_somethingelse BUTIFNONEOFTHEABOVE do_whaaat? adding a third possible execution path that does not evaluate either of the 2 statements provided, returning an arbitrary outcome that nobody wants or expects. My expectation would be that one of the statements would be evaluated at least once. I think when the list is empty, list processing should be disabled and the empty list should simply be considered an object, and judged either {} = true, or {} = false by (some) definition. Just define it, document it, and done. Definitely not return 0 in my opinion. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)