Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 25fad3315bf1769c383be9b5ab9629d55c4f07e7
      
https://github.com/Perl/perl5/commit/25fad3315bf1769c383be9b5ab9629d55c4f07e7
  Author: Paul "LeoNerd" Evans <[email protected]>
  Date:   2026-01-22 (Thu, 22 Jan 2026)

  Changed paths:
    M op.c

  Log Message:
  -----------
  Fix panic() messages in newFOROP() to actually print the right function name


  Commit: ad83cb95d2470098b0c4713137f7da4445fe7491
      
https://github.com/Perl/perl5/commit/ad83cb95d2470098b0c4713137f7da4445fe7491
  Author: Paul "LeoNerd" Evans <[email protected]>
  Date:   2026-01-22 (Thu, 22 Jan 2026)

  Changed paths:
    M op.c

  Log Message:
  -----------
  Refactor helper function for feature + warnings in op.c

New helper functions to avoid some copy-paste. Also because I'm
otherwise about to add a third copy.


  Commit: e53cc76fc60b278571d6ac2e05ff683b66b98500
      
https://github.com/Perl/perl5/commit/e53cc76fc60b278571d6ac2e05ff683b66b98500
  Author: Paul "LeoNerd" Evans <[email protected]>
  Date:   2026-01-22 (Thu, 22 Jan 2026)

  Changed paths:
    M perly.act
    M perly.h
    M perly.tab
    M perly.y

  Log Message:
  -----------
  Rename perly.y's "list_of_scalars" to "list_of_itervars"

Currently these are all scalar variables, but soon I will add the
ability for iteration variables to be refaliases, so they won't
necessarily all be scalars any more.


  Commit: 091a08d804722dadbf7ebb8762a0e3205fd5f613
      
https://github.com/Perl/perl5/commit/091a08d804722dadbf7ebb8762a0e3205fd5f613
  Author: Paul "LeoNerd" Evans <[email protected]>
  Date:   2026-01-22 (Thu, 22 Jan 2026)

  Changed paths:
    M inline.h
    M lib/B/Deparse.pm
    M lib/B/Op_private.pm
    M op.c
    M opcode.h
    M pp_hot.c
    M regen/embed.pl
    M regen/op_private

  Log Message:
  -----------
  More efficient `foreach \my $VAR` implementation

 * Define a new private op constant OPpITER_REFALIAS
 * Presence of this flag on OP_ITER means the iteration var is a
   refalias
 * Throw away the LVREF/REFGEN part of the optree in favour of just
   setting this flag

This change is useful on its own, and also a good stepping-stone towards
being able to implement multiple refalias variables in foreach; as per
  https://github.com/Perl/perl5/issues/24027


  Commit: da6c78e2121f2aee57089745e2b81c2535232cba
      
https://github.com/Perl/perl5/commit/da6c78e2121f2aee57089745e2b81c2535232cba
  Author: Paul "LeoNerd" Evans <[email protected]>
  Date:   2026-01-22 (Thu, 22 Jan 2026)

  Changed paths:
    M MANIFEST
    M op.c
    M perly.act
    M perly.h
    M perly.tab
    M perly.y
    M pod/perldelta.pod
    M pod/perldiag.pod
    M pp_ctl.c
    M pp_hot.c
    A t/lib/croak/refalias
    M t/lib/warnings/op
    M t/op/for-many.t

  Log Message:
  -----------
  Allow multivariable foreach to use refaliases

As noted by https://github.com/Perl/perl5/issues/24027, while multivar
foreach and refalias foreach have each been available separately for
some time now, it wasn't possible to combine the two until now.

This current implementation does have limits on the number of variables
in total are allowed in a multivariable foreach loop if any are
refaliases (no more than 256), and which ones can be refaliases (none
past the 24th) that are all to do with the way I am abusing the U32
`op_targ` field to store the variable count in the lower 8 bits, and a
bitmask of which vars are refaliases in the upper 24 bits. I decided to
do that as it means I don't have to make the `OP_ITER` op any larger -
such as by expanding it to an UNOP_AUX to give it that extra storage
space. In practice I don't imagine those limits will be a problem for
any practical use-case.

If in a future version we did want to expand on those limits, I think it
would be possible by moving the `refalias_mask` storage to a PV stored
in the UNOP_AUX vector, or somesuch.


Compare: https://github.com/Perl/perl5/compare/b5e0af402b59...da6c78e2121f

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to