Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I don't think you do acheive the same result, though i havn't managed to get the wX library to install so i'm not sure.

sub test { # 5 important lines while ($x) { # 10 lines of good stuff } for (1..5) { # 100 lines of crap } }

Now if you fold that recursively you get

 sub test { ... }

and then a recursive unfold yeilds to original back. However a non recursive unfold returns

sub test { # 5 important lines while ($x) { ... } } for (1..5) { ... } }

So there are cases where a user might want a recursive fold/unfold, and other where they do not. Now if you through in remembering the fold state, maybe i've already folded the "100 lines of crap" but i left "10 lines of good stuff" unfolded. If i did a non recursive fold on test, and then a nonrecursive unfold i would still be able to see my "5 important lines" and the "10 lines of good stuff" but the "100 lines of crap would not be unfolded". If however you alwas do a recursive fold/unfold then as soon as i unfold test it unfolds my "100 lines of crap"


___________
Eric Hodges

In reply to Re^3: Code Folding by eric256
in thread Code Folding by sir_lichtkind

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2023-12-03 14:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (20 votes). Check out past polls.

    Notices?