Ticket UUID: | 1237755 | |||
Title: | Bring Tcl library up to 8.4 code standards | |||
Type: | Patch | Version: | None | |
Submitter: | hobbs | Created on: | 2005-07-13 19:00:07 | |
Subsystem: | 38. Init - Library - Autoload | Assigned To: | dgp | |
Priority: | 5 Medium | Severity: | ||
Status: | Closed | Last Modified: | 2005-07-23 11:12:47 | |
Resolution: | Fixed | Closed By: | dgp | |
Closed on: | 2005-07-23 04:12:47 | |||
Description: |
Received from Patrick Fradin [patrick.fradin at synelec.fr]: (Tk submitted separately) I made next modifications joined in 2 archives : - Always use eq / ne to compare strings instead of string equal, string match, string compare, == and so on... I think it's simplify code readability and maintenance. - Replace some simple regsub with string map to improve exec performance - Replace some simple regexp with string match for the same reasons - Use unset -nocomplain to avoid if info exists or catch - Use trace add variable write/unset instead of old trace variable w/u - Use trace remove variable instead of old trace vdelete - Use trace info variable instead of old trace vinfo - use [list] to initialize empty list instead of "" or {} string - Avoid code abbreviations to clarify code and avoid reading errors ex: string len -> string length $w config -> $w configure ... - Replace some simple eval $cmd commands with "compiled" if 1 $cmd (speedier) - Use foreach to parse values instead of many lindex (ex: clrpick.tcl) - Replace regexp "dummy" variable with "->" to improve readability - I remarked some catch {destroy $w}. I think it's useless, isn't it ? | |||
User Comments: |
dgp added on 2005-07-23 11:12:47:
Logged In: YES user_id=80530 Appropriate portions applied to HEAD for 8.5a4 as well. dgp added on 2005-07-23 05:01:24: Logged In: YES user_id=80530 changed !! operations to ! ... dropped ldAout.tcl changes... committed for 8.4.12. dgp added on 2005-07-22 03:39:22: File Deleted - 142734: File Added - 142844: 1237755.patch dgp added on 2005-07-22 03:39:21: Logged In: YES user_id=80530 Updated patch does all the things from the checklist that I find appropriate and worthwhile. dgp added on 2005-07-21 05:34:06: File Deleted - 142623: File Added - 142734: 1237755.patch Logged In: YES user_id=80530 First pass does the first bullet point only. dgp added on 2005-07-21 01:47:31: Logged In: YES user_id=80530 re-opening with the intent to abandon the contributed patches and work through the initial comment checklist instead. dgp added on 2005-07-20 05:05:44: Logged In: YES user_id=80530 The revised patch still has far too much extraneous whitespace changes; making it too much work to find and review the changes of substance sprinkled here and there within the huge patch. Since this patch doesn't fix any bugs, I can't justify the review effort. If the substantive changes can be resubmitted as a cleaner patch, or even a series of smaller focused patches, that would be welcome. dgp added on 2005-07-20 04:50:30: File Deleted - 142607: File Added - 142623: 1237755.patch dgp added on 2005-07-20 04:50:29: Logged In: YES user_id=80530 Here's an improved version in patch form with the worst indenting incompatibilities removed. dgp added on 2005-07-20 03:26:48: File Added - 142607: 1237755.patch dgp added on 2005-07-20 03:26:42: Logged In: YES user_id=80530 Here's the same change set as a patch against core-8-4-branch. Unfortunately, the submitted code used a different indexing style, so the patch depicts far more extensive changes than are real. hobbs added on 2005-07-14 02:01:00: data_type - 310894 hobbs added on 2005-07-14 02:00:10: File Added - 141967: tcl8.4.11_library.tgz |