On 2021-12-18 12:05 p.m., Nicholas Clark wrote: > Likewise: > > $result = $foo ? bar() : baz(); > > I had thought - ternary, where $foo is unknown - can't take the true side, > can't take the false side, so logically surely it short-circuits to assign > $result as unknown. I would agree with that. > But then that means that to be consistent with that, here: > > if ($foo) { > bar(); > } else { > baz(); > } > > if $foo is unknown we can't enter either block Yes, and that's the answer. I would argue that when given an unknown input the effect of this block would be a no-op. Speaking more generally, the effect of unknown could be what Perl does with an empty statement block, which as far as I recall is do nothing and return undef/unknown. > So an RFC would have to go down all these paths, to figure out how to make > a language that is consistent in how it handles unknown in all places? Yes we do. -- Darren DuncanThread Previous | Thread Next