Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: RFC: Accelerated stepping

by alexm (Chaplain)
on Sep 02, 2008 at 22:25 UTC ( #708625=note: print w/ replies, xml ) Need Help??


in reply to RFC: Accelerated stepping

Before I contact p5p, I would like to hear your opinions for this proposal.

From time to time, I wonder why n doesn't jump map, grep, etc. I usually end up using c in those cases, but it's slower since I need to get the line number first. Therefore, I suggest that you try p5p, explain them grinder's comments about backwards compatibility and the idea of using N as an alternative.

BTW, maybe if it was possible to set n as an alias for N and let people decide whatever they like most would be the perfect solution. However, I'm not sure that aliasing (or redefining) commands is possible at all.


Comment on Re: RFC: Accelerated stepping
Select or Download Code
Re^2: RFC: Accelerated stepping
by hexcoder (Hermit) on Sep 04, 2008 at 07:08 UTC
    From time to time, I wonder why n doesn't jump map, grep, etc.

    Everytime a code block is entered, the Perl core delivers control to the debugger. Now it seems to me, when 'n' was created, some additional logic has been implemented, in order to shortcut the execution of subroutines, but not code blocks (like from map/grep/sort) in general.
    So I could even file a bug report :-)). That depends on your viewpoint, of course.

    Update: I think the patch could be made better, if the general problem of shortcutting code blocks is solved. Then also operators (any, all, ...) from List::Utils and friends could be stepped over. So, I will look into it again. Stay tuned...

    Therefore, I suggest that you try p5p, explain them grinder's comments about backwards compatibility and the idea of using N as an alternative.

    That is a great suggestion, thanks. I will ask them how serious they value backward compatibility in this case. Either it can be changed, or there will be a new command then.

    I will also try out, if the '=' alias can be used to redefine 'n'.

    Finally, the 'Perl Hacks' book has hack #59 for writing your own debugger commands or modifying existing ones. But since many (most?) users want the change, it might be better to change it once in the debugger source.

      Oh, I think it's a good idea to change the source. In terms of backward compatibility you've still got 's' (step into), while the 'n' (next statement) is always a pain when 'n'-ing over sort and map blocks. Of course you can 'c' (continue) to a new location (line), but then you have to stop, break your flow, and work out where you want to go specifically. It's nice to see someone prepared to delve into those murky depths to fix this behaviour to be more intuitive at last. R.
        Oh, I think it's a good idea to change the source. In terms of backward compatibility you've still got 's' (step into), while the 'n' (next statement) is always a pain when 'n'-ing over sort and map blocks. Of course you can 'c' (continue) to a new location (line), but then you have to stop, break your flow, and work out where you want to go specifically. It's nice to see someone prepared to delve into those murky depths to fix this behaviour to be more intuitive at last.

        Richard Foley.

        ps. sry, didn't mean to post anonymously earlier :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://708625]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2014-10-31 19:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (223 votes), past polls