Skip to content
Tcl Source Code History Of Ticket 306945
Login

History Of Ticket 306945

Artifacts Associated With Ticket 306945

  1. Ticket change [88ed646070] (rid 131942) by msofer on 2010-09-17 20:41:05:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      the [regexp] compiler does option completion, but the normal command does not?
      
      % regexp -n FoO dogfood
      bad switch "-n": must be -all, -about, -indices, -inline, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or --
      while evaluating {regexp -n FoO dogfood}
      % proc a {} {regexp -n FoO dogfood}; a
      1
      
      The completion feature is tested in regexpComp.test: 21.6-7 and 24.6-7
      
    4. foundin initialized to: "obsolete: 8.5.9"
    5. is_private initialized to: "0"
    6. priority initialized to: "8"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "msofer"
    10. subsystem initialized to: "43. Regexp"
    11. title initialized to: "difference between bcc'ed and eval'ed regexp"
    12. type initialized to: "Bug"
  2. Ticket change [80a50cde44] (rid 116900) by hobbs on 2010-09-18 06:57:04:

    1. icomment:
      Hmmm ... this seems to show that regexp itself is not consistent with standard Tcl option behavior, which is to allow uniq abbrs of options.  Indeed, Tcl_RegexpObjCmd uses TCL_EXACT for getopts, whereas the compile cmd does a strcmp of len >= 2.
      
      It seems like it would be consistent to correct tclCompCmds.c to enforce the full -nocase, as regexp has behaved that way since 8.0, even if most Tcl commands allow abbr opts.  Agreed?
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  3. Ticket change [3026e454c7] (rid 257516) by serhiy.storchaka on 2026-10-10 20:15:39:

    1. foundin changed to: "8.6.18, 9.0.5, 9.1.0"
    2. icomment:
      Still the same in 8.6, 9.0 and 9.1: <tt>TclCompileRegexpCmd()</tt> accepts any prefix of <tt>-nocase</tt> of at least 2 characters, while <tt>Tcl_RegexpObjCmd()</tt> requires the full option name. <tt>string compare</tt>, <tt>string equal</tt>, <tt>string map</tt>, <tt>string match</tt>, <tt>switch</tt>, <tt>lsearch</tt> and <tt>lsort</tt> all accept abbreviations of <tt>-nocase</tt>.
      
      Proposed fix in branch [/timeline?r=regexp-nocase-abbrev|regexp-nocase-abbrev]: instead of making the compiler exact, the command also accepts abbreviations of <tt>-nocase</tt>. This breaks nothing, since it only turns errors into successes. Other options still need their full names. Tests regexp-30.1 to 30.3.
      
    3. login: "serhiy.storchaka"
    4. mimetype: "text/x-fossil-wiki"
  4. Ticket change [1371752253] (rid 257797) by jan.nijtmans on 2026-10-12 20:00:26:

    1. assignee changed to: "jan.nijtmans"
    2. closer changed to: "nobody"
    3. comment changed to:
      the [regexp] compiler does option completion, but the normal command does not?
      
      % regexp -n FoO dogfood
      bad switch "-n": must be -all, -about, -indices, -inline, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or --
      while evaluating {regexp -n FoO dogfood}
      % proc a {} {regexp -n FoO dogfood}; a
      1
      
      The completion feature is tested in regexpComp.test: 21.6-7 and 24.6-7
      
    4. icomment:
      Actually, I have a problem with some options within the same command being abbreviatable and others not. No other Tcl command does that.
      
      So, my proposal variant is: [e93dfd305ea29e3b].
      
      In this specific case, I don't see any negative side-effect doing that.
      
      In general we should not advocate using abbreviated options, since it may cause incompatibilities if later options are added. But in manual typing in a shell, there's no harm, therefore many commands (especially when preceded with a minus-sign) allow that. We should - in my opinion - do the same here.
      
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. severity changed to: "Minor"
  5. Ticket change [49311822fd] (rid 257812) by serhiy.storchaka on 2026-10-12 20:37:46:

    1. icomment:
      That is a decision for you. I only considered variants for
      <code>-nocase</code>: either make it never abbreviated (simpler, but breaking,
      and inconsistent with <code>-nocase</code> in other commands), or always
      abbreviated. Making all options abbreviatable is a wider change.
      
      Note that with all options abbreviatable some prefixes are ambiguous:
      <code>-a</code> (<code>-all</code>, <code>-about</code>) and
      <code>-i</code>/<code>-in</code> (<code>-indices</code>, <code>-inline</code>)
      in <code>regexp</code>, and <code>-l</code>/<code>-li</code>/<code>-lin</code>
      in both commands. <code>-line</code> can only be used in full, and
      <code>-a</code> would mean <code>-all</code> in <code>regsub</code> but be an
      error in <code>regexp</code>. <code>-n</code> is unique in both.
      
      Two related mismatches between compiled code and the command, where the
      compiler accepts an abbreviation that the command rejects as ambiguous:
      [1ae976e237] (<code>clock clicks -mi</code>, new in 9.1) and [8ab06e31e3]
      (<code>self n</code>).
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
  6. Ticket change [0d7b2d3ad2] (rid 259099) by jan.nijtmans on 2026-10-18 21:15:12:

    1. icomment:
      Merged to [43345b959d|trunk] and core-9-0-branch.
      
      Merge to 8.6 still to be done
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
    4. resolution changed to: "Fixed"
    5. status changed to: "Pending"
  7. Ticket change [8a6a1569a9] (rid 261368) by oehhar on 2026-11-10 16:28:08:

    1. closedate changed to: "2461355.1862096298"
    2. closer changed to: "oehhar"
    3. login: "oehhar"
    4. mimetype: "text/plain"
    5. status changed to: "Closed"