On Thursday, January 10, 2019 at 12:47:24 PM UTC-6, Edward K. Ream wrote: > [The refactor] branch contains a thorough refactoring of the top-level atFile output code.
Lot's more progress to report: - Created new methods, renamed methods, and improved methods. - Eliminated two more kwargs: 'kind' and (hurray) 'trialWrite'. 'sentinel' is the only remaining significant kwarg. Imo, it's benign. - Verified that *all* write code writes to strings (a g.FileLikeObject) initially. File oriented methods call at.replaceTargetFileIfDifferent only when all string writes complete successfully. *Summary* The new XToString methods simplify everything. Vitalije's "method splitting" pattern is a great success. To do: Discover how the at.outputFileName ivar is used, if it *is* actually used. Edward P.S. We could use ideas from functional programming to eliminate tests against the at.sentinels switch in the "downstream" code. Indeed, we could bind "specialized" methods that do (or don't) generate sentinels. However, the present code is the *clearest* thing that could possibly work, and the performance gains are not even close to justifying the extra complexity. Furthermore, it is absolutely essential that the code generates *exactly* the same output (except for sentinels) regardless of the at.sentinels switch. The present code guarantees this constraint. Specialized code might not. EKR -- 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.
