Skip to content
Tcl Source Code History Of Ticket 2974744fffffffffffffffffffffffffffffffff
Login

History Of Ticket 2974744fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 2974744fffffffffffffffffffffffffffffffff

  1. Ticket change [a04df92daa] (rid 96782) by dgp on 2010-03-22 18:26:32:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      I see that the [try] implementation has a
      table of Tcl's built-in exception code,
      duplicating the table already in the
      [return] implementation.  Might be
      worth factoring this out.
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "dgp"
    10. subsystem initialized to: "None"
    11. title initialized to: "share exception codes (ObjType?)"
    12. type initialized to: "RFE"
  2. Add attachment "tclResult.c.patch" [ec28841ce0] (rid 103665) by nijtmans on 2010-03-23 20:51:34.

  3. Ticket change [eb22f931a6] (rid 103483) by nijtmans on 2010-03-23 20:51:35:

    1. icomment:
      
      
      File Added - 367871: tclResult.c.patch
      
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  4. Ticket change [457afcc399] (rid 99358) by nijtmans on 2010-03-23 20:54:15:

    1. icomment:
      Here is a first attempt at such a function. A separate ObjType is not very
      useful, because the implementation is already covered by an integer
      object and an index object. But a separate parse function (see patch)
      could be useful to extensions as well.
      
      Missing: documentation, integration with "try" command, addition to stub table.
      
      Is this similar to wyat you had in mind?
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  5. Ticket change [9aaa7b7802] (rid 110988) by dkf on 2010-03-23 20:57:43:

    1. icomment:
      Make it private to Tcl for now. Like that we don't need to document it or put it in any stub table. (We can expose later if we want, but not all "parse" functions are exposed IIRC.)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  6. Ticket change [0d8ec20b9d] (rid 114384) by nijtmans on 2010-03-28 05:28:14:

    1. assignee changed to: "nijtmans"
    2. icomment:
      working on it
      
      
    3. login: "nijtmans"
    4. mimetype: "text/plain"
    5. resolution changed to: "Accepted"
    6. subsystem changed to: "20. [interp]"
    7. username: "nijtmans"
  7. Ticket change [034b9774ec] (rid 119801) by nijtmans on 2010-03-28 05:40:59:

    1. closedate changed to: "2010-03-27T22:40:59"
    2. closer changed to: "nijtmans"
    3. icomment:
      
      
      allow_comments - 1
      
      Fixed in HEAD. Made it private function, as dkf suggested. Added
      (trivial) integration with "try" command.
      
      
    4. login: "nijtmans"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "nijtmans"
  8. Ticket change [cd1fc5496e] (rid 95828) by dgp on 2010-03-28 09:13:34:

    1. icomment:
      
      Thanks, I think that's a step in the
      right direction.
      
      The thought I had with ObjType was
      along the lines of Tcl_GetBooleanFromObj(),
      so that the string values "ok", "error", etc.
      could hold the corresponding integer values
      as their internal reps.  Not critical at all to do,
      but possibly a further future enhancement.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  9. Ticket change [de60b55314] (rid 114837) by nijtmans on 2010-03-29 03:58:46:

    1. icomment:
      Answer to dgp: I think that's the new function TclGetCompletionCodeFromObj already doing: It will convert the object to index type, which has indeed the integer value as its internal rep. There is no new object type needed for that, the index object type already does this. If the original string rep already is an integer, it will be converted to an integer object type. What more do you want? ;-)
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  10. Ticket change [05946a5fa4] (rid 89085) by nijtmans on 2010-03-30 20:21:26:

    1. icomment:
      Added one further optimization: If the object type is indexType
      already, it makes no sense to check if it is an integer. This
      is indeed more in line with Tcl_GetBooleanFromObj, which does
      every effort not to do useless conversions. Moved the function
      to tclIndexObj.c, so we can make use of indexType.
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  11. Ticket change [5ff21b1fc8] (rid 115908) by dkf on 2010-03-31 04:15:47:

    1. icomment:
      changes behaviour of [try]: now can't do this:
        try { ... } on err {} { puts Whoops! }
      but instead need a full
        try { ... } on error {} { puts Whoops! }
      
      Impacted Schelte Bron's code.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  12. Ticket change [8b96e7a33e] (rid 127594) by dkf on 2010-03-31 04:15:48:

    1. icomment:
      
      
      allow_comments - 0
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "dkf"
  13. Ticket change [9ad49a1feb] (rid 111021) by dgp on 2010-03-31 04:45:08:

    1. icomment:
      
      I do *not* what [return -code] to start
      accepting abbreviations.  If [try] needs
      to do so, then I was mistaken about thinking
      this was a good refactor.  Sorry.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  14. Ticket change [9339ccd661] (rid 105782) by nijtmans on 2010-03-31 12:54:41:

    1. icomment:
      So, why don't we give the new function a flag argument, which
      describes whether we accept exact abreviations or not?
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  15. Ticket change [86939861b7] (rid 131536) by nijtmans on 2010-03-31 13:46:40:

    1. icomment:
      Thinking more about it: I agree with Donal,
      and I recommend to keep it as is. Because:
      - Tcl currently mainly accepts abbreviations in two cases:
            - option arguments starting with "-"
            - commands and ensemble subcommand,
              when in interactive mode
      - If it was intended that try accepts abbeviations, there
        should have been a test case for it.
      - Abbeviations only cause trouble when new return values
        are added: a new "error2" code whould start breaking
        Schelte Bron's code as well.
      - TIP #329 mentiones:
      The on handler allows exact matching against the exceptional return code (the integer value that would be returned by catch). The code may be given as an integer or one of the magic keywords ok (0), error (1), return (2), break (3), continue (4).
        it doesn't mention the possibility of abbreviations.
      - Error codes are short, so I don't see much added
        value in allowing abbreviations.
      
      Things to do:
      - have a look at the current try documentation.
      - add test case for [try], showing that use of
        abbreviations result in an error.
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  16. Ticket change [e5583935dd] (rid 88113) by nijtmans on 2010-03-31 14:04:24:

    1. icomment:
      >Thinking more about it: I agree with Donal,
      Of course, I meant Don!
      
      The results show that this WAS a good
      refactor:
      - It discovered that the error messages
        used by the try command were not
        consistent with the return command.
      - It discovered that the original try
        implementation did not match the TIP.
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  17. Ticket change [0d65bd0aba] (rid 114354) by dkf on 2010-03-31 15:34:38:

    1. icomment:
      My code (I'm wholly responsible^Wto blame for the C implementation of [try]) accepted 'err' just because I couldn't be bothered to make it not do so. I'll have to apologize to Schelte for breaking his code, but it's for the best.
      
      (And yes, more tests would be great.)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  18. Ticket change [a90b1ceb53] (rid 99089) by nijtmans on 2010-03-31 17:31:24:

    1. closedate changed to: "2010-03-31T10:31:24"
    2. closer changed to: "nijtmans"
    3. icomment:
      
      
      allow_comments - 1
      
      - Checked documentation: It only handles exact matches, so it is consistent with the TIP
      - Revised test cases, checking for the error case when using abbreviations.
      
      So, this issue can be closed.
      
      
    4. login: "nijtmans"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "nijtmans"