On Tue, 24 Aug 2010 12:52:18 -0500
"Edward K. Ream" <[email protected]> wrote:

> On Mon, Aug 23, 2010 at 2:40 PM, Kent Tenney <[email protected]> wrote:
> 
> > Your fault or no, Leo should not jumble code it doesn't agree with, I 
> > consider
> > this a serious bug.  
> 
> Leo's "perfect import" logic should guarantee that an @ignore
> directive gets inserted in situations where the resulting output would
> not be "substantially identical" to the input.
> 
> What "substantially identical" means depends on the language.  Python,
> for example, is a "strict" language, which means that leading
> whitespace is considered to be sacrosanct.

It's not a question of altering or damaging the code on disk, it's a question 
of loading the code into nodes in a manner that makes it hard to interpret.  
Given Leo's strengths as a platform for getting into other people's code, this 
is something to avoid.

> I do agree that the import logic, especially for Python, could be
> improved to put inter-def stuff with the previous node rather than the
> next.

In that case that would have helped, but in others it would be just as bad:

    def dont_look_at_me():
        """Obscure 'Young Ones' matchbox reference"""

        print "I'm irrelevant"

    Storage_Base = SQLiteStore
    
    def make_storage(path):
        x = Storage_Base()
        x.init(path)
        return x

Here the inter-def belongs with the following def - hiding it in the 
'dont_look_at_me' node would leave someone assuming Storage_Base came from an 
import or similar.  Hence the (not universal :-) conclusion from the previous 
thread that inter-def stuff should get its own node.  Or at least there should 
be a configuration option for that behavior.

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to