http://qs321.pair.com?node_id=733344


in reply to Re^2: Code Folding
in thread Code Folding

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