Perl / Perl/PPCs

[PPC0030] - Clarifications on `use overload` interaction

Open
#87 2 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

The PPC document doesn't actually talk about use overload at all.

In the course of implementing it (https://github.com/Perl/perl5/pull/24304), currently I have fully created an overload category for the equ and === operators, allowing a class to use overload equ => ... to specify its overloading behaviour here.

But I wonder if this should be considered correct, or not. We say that the equ operator's behaviour can be explained in terms of some defined checks and the eq operator. While we allow the eq operator to be overloaded, we don't allow defined to be.

I wonder if therefore, we should say that equ (and related) are not independently overloadable, but instead are just implemented in exactly these terms - a defined check first that cannot be overridden, followed by a possibly-overloaded eq check.

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 by reading the PPC document and the linked perl5 pull request, then review how use overload currently treats equ and ===. Done means the interaction is resolved as a clear specification decision and the PPC document explains whether these operators are independently overloadable or defined through defined and eq.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
compilers, documentation
Issue type
Documentation
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.