On Wed, Jan 18, 2012 at 3:50 PM, Terry Brown <[email protected]> wrote: > On Wed, 18 Jan 2012 15:14:52 -0500 > Seth Johnson <[email protected]> wrote: > >> Is it correct to say that you'll have no problems if you use the Leo >> app and just freely and unthinkingly use clones in one Leo file? No >> cross-file clones? > > Can you restate the question? All clones live within a single Leo > file, cross-file clones occur between derived @<file>s within a single > Leo file.
First, I think you answered the question: no. But I'm still unclear what a cross-file clone is. Is it a clone that's in the one leo file, pointing at external file A, while within the @file branch for external file B? If that's the case, it strikes me that part of the problem is that -- I think -- the cross-file clone is already being treated like a templating function -- isn't that what you'd mean by having a clone for file A inside the @file branch for file B? I think templating in that pattern is different from cloning in the sense Edward uses them. One could have a rule that the app enforces, keeping you from doing that (pasting a clone from one file under the @file for another), and doing so would make perfect sense. Then the business of templating can be treated and implemented as something else, rather than something that just happens (suddenly doing templating rather than just grouping clones for clarity) when you create a cross-file clone. >> The generating content thing is in tension with the fact Leo is a tool >> for working with external files for a particular kind of purpose: >> editing code, which is linear and of a nature where things have their >> (one) place. You're doing something wrong if you're creating external >> code files that are designed to have many places update with the same >> actual textual code, which you are aiming at changing in one location >> and having multiple places in the external files update textually and >> redundantly from that. Code isn't like that: you call a function that >> resides in its one right place, and update that single instance of >> that function, not replicate the text of that function all over. > > Leo's not intended to be limited to editing code. Personally I'm happy > using whatever code-domain specific solution is appropriate for > handling repetition, `import` in python, `.. include:` in rst, some > templating language for XML or text generation. But it seems like > people keep getting in to trouble trying to use clones to do that sort > of thing. Maybe the problem's not that big, the use-case is not that > common, but unfortunately it leads to "Leo ate my data" threads. > > On top of which, given the way template systems like jinja and Genshi > work, I think they'd integrate into Leo in quite powerful ways. I've > actually used Genshi like that for making a website where a Leo node is > the template and its children are data for items which need to be > rendered in the template. > > Maybe there's no way to stop people shooting themselves in the foot > with a tool as complex and versatile as Leo - I just think that with > clones they sometimes don't know the gun's loaded until it's too late. But my point is that the concept of templating is fundamentally at odds with maintaining a codebase. Therefore, if I'm getting what you mean by cross-file clones, cross-file clones shouldn't automatically do templating. So while people may have gotten excited with the prospects of doing cloning even across external files, there's a difference in function that seems to have been implemented without recognizing it. Seth > 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. > -- 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.
