I try to be consistent in my writing
of syntax.
I consider syntax a means of communication the the computer but in many circumstances also to people. There are many reasons wanting to do good writing running from (1)being clear to myself to (2) teaching to (3) clearly explaining to the court what the plaintiff is asserting. even A by itself would help. A. A simple start would be to list all of the elements that are not in comments and all of the casing variations for those elements compute Compute ComPute eq EQ eQ Dateofbirth DateOfBirth DATEOFBIRTH (yes I know this is easy in WordPerfect or NoteTab, but that s/w would not have access to the color of the element for the next step.) B. The next step might be to sort them by the color they are then alphabetically C. A third step might be to ask interactively which casing is wanted and produce a new draft of the syntax. D. A later phase of development would ask what casing to use for elements with certain colors as a group. As time goes on the tool could then be enhanced according to suggestions, rewrites, etc. from users. Maybe in the long run there could be a Grammatik of syntax with a list of things that could be checked or not according to the style of the writer. <tongue-in-cheek on> In the 70,s there was program that was the opposite of PRETTY. UGLY would remove all comments and indentation. all lines number would be replace with 4 digit line number. It would replace variable names with randomly generated long strings of I think 32 characters (the longest a variable name could be). age ==> abdrwqhihhtdsdggygyufdcvdd sex ==> hhgjgggyftftyreseuhukuyuttytt etc. The code would still compile and execute the same but it would be hard to reverse engineer. <tongue-in-cheek off> -- Art Kendall Social Research Consultants
Art Kendall
Social Research Consultants |
Administrator
|
Well Art, Why not write such a beast rather than waiting around for someone else to do so? You seem to be dipping your feet into python. This sounds like a fairly simple project. UGLY! Code obfuscator? I think I know someone who has a copy.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
I could probably get to
it in August. I am buried in obligations right now. Maybe a dozen years of retirement have slowed me down.
However, sometimes it does help to see if someone has invented a wheel. One of my many soapboxes is how often wheels are reinvented rather than improved. At one time I had 11 different one way ANOVA programs. I then looked at them and cannibalized ideas and code to enhance one rather than starting from scratch. Right now I can just paste the syntax into NotePad and get a list of all the "words". an alpha sort puts them next to each other. IIRC there is a Python to do word frequencies in texts and I may try it out. I'll check the archives One of the things that PRETTY did to FORTRAN code was to re-sequence the line numbers. The first one encountered in the code became 10, the second 20 etc. IIRC UGLY just removed all comments, read the CREF, swapped in a big string for every variable and re-sequenced the line numbers so that the first encountered was given a random 4digit line number, the second a different random line number, etc. Art Kendall Social Research ConsultantsOn 5/13/2013 10:21 AM, David Marso [via SPSSX Discussion] wrote:
Art Kendall
Social Research Consultants |
Administrator
|
Maybe we could find a group of talented people and each of us build parts of it.
Before we throw down it would be essential to sniff out requirements and spec out the design. I am likely to build out my rewrite of the 'SPSS code sniffer' tool before I get to any 'prettyfier'. My code usually comes off my finger tips in a ready to consume form so my personal need for such a tool are somewhat limited. OTOH: What I have in mind re the 'syntax inquisitor/SPSS code sniffer' might find a place for a a prettifier utility. Seems a hack job would require about a day. A solid job a week. OTOH: I don't do hack jobs.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Free forum by Nabble | Edit this page |