Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dumper.pm to hint at \( .... ) two birds one stone #22039

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from

Conversation

jidanni
Copy link
Member

@jidanni jidanni commented Feb 27, 2024

Welcome to edit my patch.

@khwilliamson
Copy link
Contributor

This needs a version bump

will be remedied in time, now that Perl has subroutine prototypes.
array or hash. Prepend it with a C<\> to pass its reference instead:
Dumper C<\>(%a, @b, $c), C<\>%e, C<\>@f, C<\>$g.
This will be remedied in time, now that Perl has subroutine prototypes.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who is going to remedy this?
At what time?
How do prototypes remedy with this?
Are you thinking of signatures?

Copy link
Contributor

@nicomen nicomen Feb 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps that's a question for the original commit including that statement? Althought history seems to stop here: 823edd9

It seems however to refer to standard prototypes and not the new signatures.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point was more that the vibes are wrong. Optimistic use of future tense and prototypes really don't mix in $current_year

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's definitely not a change we will be making. That sentence should be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes please remove it or whatever and also tweak my version if you want I'm very welcome.

I guess I'll learn what a version bump is a little later. But just go right ahead.

array or hash. Prepend it with a C<\> to pass its reference instead. This
will be remedied in time, now that Perl has subroutine prototypes.
array or hash. Prepend it with a C<\> to pass its reference instead:
Dumper C<\>(%a, @b, $c), C<\>%e, C<\>@f, C<\>$g.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\( ... ) is a list of references to each of the items in the parens. \( @things ) is not a reference to @things, nor a reference to an anon-array with the items from @things:

% perl -MData::Dumper -E '
  say Dumper \( @ARGV ) 
'  -- two items
$VAR1 = \'two';
$VAR2 = \'items';

\( %things ) does the same with the key/value pairs from the hash:

 % perl  -MData::Dumper -E '
  my %arg = @ARGV; 
  say Dumper \( %arg ) 
' -- one pair
$VAR1 = \'one';
$VAR2 = \'pair';

Dumper \(%a, @b, $c) is not a good example of how to avoid list flattening.

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.

None yet

5 participants