develooper Front page | perl.perl5.porters | Postings from May 2023

runtime-undef not folding

From:
"Ruud H.G. van Tol" via perl5-porters
Date:
May 17, 2023 15:04
Subject:
runtime-undef not folding
Message ID:
5618db77-1bee-746a-89d0-32a73b037f22@isolution.nl

Some examples:

$ perl -MO=Deparse -e'"" || 1'
'???';
-e syntax OK

- - - - -

$ perl -MO=Deparse -e'undef || 1'
'???' unless undef;
-e syntax OK

- - - - -

$ perl -MO=Deparse -e'
   use constant F => undef;
   F and 1;
   undef and 2;
'
use constant ('F', undef);
'???';
'???' if undef;
-e syntax OK

- - - - -

So compile-time-undef folds,
but runtime-undef doesn't.

(which initially surprised me, but now looks fine with me)

-- Ruud




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About