Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d3edc995cc1c386a1c8df71310a294c49cfc550a
Ticket: 1446696fffffffffffffffffffffffffffffffff
Tcl_ParseArgv as a useful non-Tk version of Tk_ParseArgv
User & Date: dgp on 2006-06-17 03:00:36
Changes

  1. icomment:
    Logged In: YES 
    user_id=80530
    
    
    For me, it would be easier to review
    the code if it were a patch against
    the Tcl sources.  Stick the new routines
    in tclIndexObj.c.  Follow the engineering
    manual, please.
    
    The set of types indicated by
    TCL_ARGV_* is incomplete.  Look
    at the full list of TCL_LINK_*
    types now supported by Tcl_LinkVar.
    In fact, can we just have these
    routines just re-use the TCL_LINK_*
    values?
    
    The Tcl_ParseArgv() and
    Tcl_ParseArgvObj() routines are
    separate implementations.  Seems
    to me it would be better to
    implement one, and make the other
    a thin wrapper around it.  I'd
    have the Tcl_Obj one be real, and
    the string-based interface as a
    wrapper, if we even bother to have
    it at all.
    
    The TCL_DONT_SKIP_FIRST_ARG flag
    seems pointless.  Just expect the
    caller to pass in the correct value
    for objv.
    
    It's not clear to me that having
    a "-help" option always recognized
    is more useful than it is annoying.
    Who are the expected callers of
    these routines, and are they expected
    to want a "-help" more often than not?
    If we drop that, we drop the whole
    defaultTable, as well as the need for
    the TCL_ARGV_NO_DEFAULTS flag.
    
    TCL_ARGV_NO_ABBREV has the same meaning
    as the existing TCL_EXACT, right?  Why
    not re-use that?
    
    Rather than require objv to be over-writable,
    I think I'd be happier with a routine
    that took a const objv and an optional 
    &remainingObjv argument, for sake of those
    callers that want to know the unparsed
    options.  With that revision, it would
    be possible for the caller to manage
    the reaction to whether or not all objv
    values are consumed, so TCL_ARGV_NO_LEFTOVERS
    would no longer be needed either.
    
    I think that does away with the need
    for the flags argument entirely.
    
    I guess that's enough for now.
    
    
    
    
  2. login: "dgp"
  3. mimetype: "text/plain"
  4. username: "dgp"