On Friday, June 5, 2020 at 11:10:24 AM UTC-4, vitalije wrote: > > For the past few days I've been working on the reusable functions for both > parsing content of external files and writing external files. In the > attached Leo document there are two new scripts. One is for generating the > test data, and the other is for testing these two new functions. All tests > are passing and round trip (*text-> outline -> text*) confirms that these > functions have almost the same effect as Leo's FastAtFile reading and > atFile writing methods. > > Thinking about the format of external files and looking at them, I've come > to the conclusion that this format contains some redundant information. > This is not a big problem, but since I am currently working on this part of > the Leo's code base, I wish to propose some improvements to this format. > Having redundant information means that different files may produce the > same outline. This can cause problems when testing round trip > transformations. > > First of all I have to say, that I wrote two simple scripts that can > automatically convert current external file content to the new format and > back to the original format. > Also so called "dangerous directives" (*@comment* and *@delims*), are > never used in the Leo's code base. Personaly I can't think of the use case > for those directives. If anyone knows for a specific use case where these > directives can solve a real life problem which can't be solved without > these directives, please share it here. I wish to understand why would > anyone wish to use these directives. If no such use case can be found, I > would strongly suggest dropping support for those dangerous directives. It > would allow us to further simplify both reading and writing code. > [snip] > Less sentinel lines means less parsing less ambiguity and less work which > leads to both simpler code and faster execution. > > Your thoughts, please. >
I just used @delims the other day for a Windows command file. In cmd files I use "::" as a comment marker. I didn't find a Leo file type for cmd files, so I just went ahead and used the directive. I have used it a few other times over the years. I imagine that @comments is also needed from time to time. I can't be the only one. So I wouldn't get rid of these two. I'm all in favor of simplifying code, but I think you may be drifting into the area of premature optimization. -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/2f73a133-4a9e-44e7-8e13-66f92f820a74o%40googlegroups.com.
