On 5/6/22 1:15, Oodler 577 via perl5-porters wrote: > * breno <oainikusama@gmail.com> [2022-06-04 00:04:36 -0300]: > >> >> My comments on the PSC call this morning were mostly that I felt the most >>> valuable simplification would be to provide an explanation of ?-> in terms >>> of what it's equivalent to. For example: >>> >>> EXPR1 ?-> EXPR2 >>> >>> # is equivalent to >>> >>> defined EXPR1 ? EXPR1->EXPR2 : undef >>> >>> # with the caveat that EXPR1 is only evaluated once > > I like this, but what distinction does "defined" or "truthy" > hold with references? > > It seems necessary for this to even be "true", the following > conditions must hold: > > * it's not undef > * it's blessed > * it "can" EXPR2 Don't forget that perl allows one to call methods on strings as in... $class = 'Foo'; $class->new(); So, "?->" requiring a reference there would be inconsistent.Thread Previous | Thread Next