Skip to content

Add .WHERE, .DEFINITE and .REPR to list of reserved methods#4767

Merged
schultzdavid merged 5 commits intomainfrom
schultzdavid-patch-7
Mar 13, 2026
Merged

Add .WHERE, .DEFINITE and .REPR to list of reserved methods#4767
schultzdavid merged 5 commits intomainfrom
schultzdavid-patch-7

Conversation

@schultzdavid
Copy link
Copy Markdown
Collaborator

@schultzdavid schultzdavid commented Feb 6, 2026

These are three items from the Checklist for 2026.01 (#4758), which were introduced with commits a0a198d, 62927745 and 971b2fa4 respectively. They apply from Rakudo 2026.01 (as is stated in the new text).

Question: Do all three VMs for Rakudo have a moving or compacting garbage collector? I found evidence of this only for MoarVM (here), but am not sure about the particular JVM and JS VM.

Context: The two other files that say something about WHERE explain that its return value may change due to garbage collection:

These files don't need changing because of these commits, but we could take the occasion to make sure that both places tell the complete and correct story.

This change was introduced with commit a0a198d and applies from Rakudo 2026.01.
as introduced by commits 6292774 and 971b2fa4
@schultzdavid schultzdavid changed the title Add .WHERE to list of reserved methods Add .WHERE, .DEFINITE and .REPR to list of reserved methods Feb 6, 2026
@schultzdavid schultzdavid marked this pull request as ready for review March 7, 2026 22:57
@schultzdavid
Copy link
Copy Markdown
Collaborator Author

schultzdavid commented Mar 7, 2026

PR can be merged.

The point about garbage collection is a separate and minor topic.

@schultzdavid
Copy link
Copy Markdown
Collaborator Author

schultzdavid commented Mar 12, 2026

I think one should also append a warning about using .WHAT & co. together with hyperoperators:

B<Warning:> Using the above-named special methods together with hyperoperators
can lead to unexpected results.
For example, as of Rakudo v2026.02,
C<[1,2,3]».WHAT> gives C<Array> instead of C<[Int, Int, Int]>.
(Calls like C<[1,2,3]».&WHAT> or C<[1,2,3]»."WHAT"()> do give C<[Int,Int, Int]>,
but their behavior is not guaranteed by the test suite.)

Indeed, despite rather extensive searching I did not find any tests of combinations of hyperoperators with WHAT/WHO/HOW/VAR/WHERE/DEFINITE/REPR.

@lizmat
Copy link
Copy Markdown
Collaborator

lizmat commented Mar 12, 2026

Please make a rakudo issue for this. [1,2,3]>>.WHAT is being codegenned as [123].WHAT, completely losing the >> aspect.

@schultzdavid
Copy link
Copy Markdown
Collaborator Author

Rakudo issue created here: rakudo/rakudo#6084 :)

@schultzdavid schultzdavid merged commit b44080e into main Mar 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants