True, but now I *do* understand why I am *not *going to make the changes!
> > As elegant as changes the changes seem, my background mind has been > *screaming* at me that they are a bad, bad, bad idea. > > I inserted a new_lines switch in linescanner.py and actually starting > converting the code to the new way. And then, suddenly, I *did* > understand why my background mind was screaming. > > Using s.splitlines forks Leo's code. You could call it a hidden mode bit. > All future maintainers would have to *remember* that the importers *must* > use s.splitlines instead of g.splitLines. > > Sure, the new code i > s > better > locally > . But > global > consistency is > *way* > more important. > Besides, the proposed changes have no practical impact, whereas effort > required to change and test the code are substantial. > > I've spent decades using g.splitLines. It's *everywhere* in Leo's code. > I'm not about to start using two different conventions for lists of > lines. > > > It *might* have been been better to have used s.splitllines > instead of g.splitLines. But no, s.splitlines's bool argument is > *another* mode bit. That bool would again fork pieces of Leo's code. > > *Summary* > > Leo's code handles lists of lines consistently everywhere. That should > remain a strict principle, especially for major components such as Leo's > importers. > > We'll just have to live with whatever slight inconveniences the global > consistency entails. > > It's ok to use s.splitlines in local situations, provided that doing so > has no global impacts. > > EKR > I don't see why you have to break the global consistency. If you change 's.splitlines(True)' to 's.splitlines(False) in g.splitLine, your interface to g doesn't change at all. The change would be strictly localized (as it should be). You don't need no mode switches for code forks. All the strip() commands that are scattered around the code, don't change their results, though they might be now superfluous. And you get the advantage that new code gets easier to write because you don't have to strip the newlines anymore. Of course this only holds if you don't need the newline characters somewhere, what I don't know. Reinhard -- 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.
