Am 22.03.2023 um 02:49 schrieb Cottrell, Allin:
Yes, again the point is: why do we need this if block with the exists() check in the first place when all we want to do is to channel opts to bcheck?Sorry, I don't really understand this example. If opts is not supplied there's nothing to be checked, so one should simply do if exists(opts) bcheck(&defaults, opts) endif
One addendum to this problem, based on real-world code: It is not unusual that there is a middle function layer before the bcheck() function comes into play. In a stripped-down pseudo example:
<hansl>
function void toplevel (matrix myinput, bundle options[null])</hansl>
This example will currently fail at the first line inside toplevel(), even though the bundle arg is marked as optional at all function levels! Sure, one can insert more checking code with exists(), and that is currently the workaround. But does it have to be that way forever?
thanks
sven