Perl / Perl/PPCs

PPC 21 - short circuiting and lvalue

Open
#71 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
79
Forks
28
PR merge metrics
No merged PRs in 30d

Description

What should happen with this code

$undef?->[0] = die

In the undef case, should this shortcircuit the assignment RHS, or run the code and not store it?
Similar question for

($but?->{why}, $for_sure) = (9001, 9002)

Considering the second, it would seem like we wouldn't necessarily wanna short circuit. Perhaps it doesn't make sense to use optchain as an lvalue?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the two Perl examples in the issue and review the surrounding discussion about optional chaining as an lvalue. Determine the intended behavior for RHS evaluation and tuple assignment when the chain is undef. Done means reaching an agreed language-semantics decision and documenting the proposal; no files or tests are named.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.