Hello Richard,

I discussed this topic and patch on PerlMonks, and got a general
agreement, that the patch would have great merit.

The Problem
===========
Then I discovered a corner case I don't handle well:

$c++; $d++; $e++; print 'map';

will not work as before with 'n'.

Suddenly I found the detection of map/grep/sort
with a regexp very weak and fragile. So I am not content yet.

The Idea
========
When I looked into the debugger source, it seemed to me then
(lightbulb on) that the special treatment of 'n' regarding 
subroutines only needs to be extended to general code blocks 
like those in grep/map/sort, and 
like those in any/all/...
if you use List::Utils and List::MoreUtils.

Evidence
========
While experimenting I found that sort without a code block
was stepped over with a single 'n'!
When a code block was given, that was not the default one,
'n' stepped into each invocation of the code block and stopped.

Probably that is also the reason that join and reverse are stepped
over with a single 'n'. They don't have user supplied code blocks.

Seen that way the special treatment of 'n' was 'sort of' incomplete
because it shortcutted only code blocks of explicitly declared
subroutines.

New Plan
========
So I would like to make a patch now, that will have 'n' short cut for 
ANY code block, not only subroutines. And that should be done without a
regexp.

Help is of course very much appreciated!!

What do you think?

Geetings,
Heiko

Reply via email to