On Wednesday, May 30, 2018 at 12:25:43 PM UTC-5, Edward K. Ream wrote:

The following functions contains "numbered" children whose order is 
> implied. The edicts mean that these nodes should define explicit sections:
>
> promote
>   1. promote this part of outline
>   2. update clones of this node in outline
>   3. update sizes in outline
>
> Similarly for promote_children, indent_node, and load_derived_file.
>

Still true, and easy to do. 

The section refs in all these functions should be converted to helper 
> functions. The helper sections are called infrequently.
>

*load_derived_file is a special case*.  The edicts require only that 
@others be converted to section references, like this:

def load_derived_file(lines):
    '''Returns generator which yields tuples:
       (gnx, h, b, level)
    '''
    flines = tuple(enumerate(lines))
    first_lines = []
    << 1. first_lines & header >>
    << 2. define patterns >>
    << 3. handle the top node >>
    << 4. iterate lines >>
    << 5. dump nodes >>

The edicts say only that this is much better style than using @others.

Here, converting << 4. iterate lines >> to a function might have real 
performance consequences, because references to flines and other vars would 
become *nonlocal* references. 

*Summary*

The edicts require only that implicit sections be eliminated. They do *not* 
require changing section references to functions/methods. Doing so in 
load_derived_file might slow the code.

I'll say more about statistics and performance in another thread.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to