On Mon, Jan 16, 2012 at 10:39 AM, Terry Brown <[email protected]> wrote: > [egotistical repetition of my posting which was buried in another > thread]
No problem. We have been discussing a lot lately. The repetition is appreciated. > Leo's clones are very appealing [for reducing code repetition] However I > don't think (Edward?) that was what they were designed / intended for. 15 years ago I didn't realize that clones (sections) are bad style compared to functions. So my original intentions and designs have changed considerably. Also, Python makes it easy to replace sections by functions returning lists of values. With Pascal and C this is much less convenient, which tempts people to use sections when they should not, imo. > Rather, [clones are] intended to provide views / collections / bookmarks of > currently interesting parts of files. That's how I use clones. As I said, I consider cloned section definitions to be bad style, especially when used between files. Of course, html-like languages don't have functions, so something must be done, regardless of style. > Personally I think UNLs are a safer way of doing that, but clones do it very > nicely, as long as you don't break the rules. UNL's are indeed a different way of referring to nodes, but clones have the great advantage of showing all their descendants. > That's where I think these issues about what clones do is coming from. > > Perhaps Leo could offer some kind of generic solution by providing some > sort of templating system which could be applied to any text file > output. But it would still require a distinction between source files > and output, or built, files. Kind of cross-file section references. Interesting idea. It's likely no accident that templating systems are so popular on the web, because of the deficiencies of html and xml. Feel free to discuss ideas for templating in Leo. It might help a lot of people. Edward -- 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.
