Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^4: Features missing in perl IDEs?

by BUU (Prior)
on Jun 17, 2005 at 23:08 UTC ( #467897=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Features missing in perl IDEs?
in thread Features missing in perl IDEs?

Wow. An elightening explanation. One more question though. You say when you're extracting methods for the perl code, "Figure out what local vars it needs and pass them as arguments". Why don't you have to do this for the java code?

As I was writing this, it occurred to me that you don't have to do it because the java one scans your selection for variables and automatically determines which variables you need passed. In which case, I really think that's fairly doable in the perlworld, especially now that we have PPI.

I have to admit, the entire point of this thread was so I could think of something cool to do with PPI, as I think it's a really incredible module.. I just couldn't think of anything useful to do with it!

As an example, if you had this as your code selection:

my $x = frob( $bz ); print $x + $z; foobar( $x );
Using the power of PPI it should be trivial to generate a new method:
sub methodname { my ($bz, $z ) = @_; my $x = frob($bz; print $x + $z; foobar( $x ); }
Is that more or less what you had in mind?


Comment on Re^4: Features missing in perl IDEs?
Select or Download Code
Re^5: Features missing in perl IDEs?
by adrianh (Chancellor) on Jun 19, 2005 at 01:42 UTC
    As I was writing this, it occurred to me that you don't have to do it because the java one scans your selection for variables and automatically determines which variables you need passed.

    Yup.

    Using the power of PPI it should be trivial to generate a new method ... Is that more or less what you had in mind?

    Yup. With the addition of the original selection being replaced by a call to the new method. extract_subroutine() from Devel::Refactor does a fair job of this particular task already.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-08-23 11:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (173 votes), past polls