Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6b933070629a3e8b1fd09d4e7e8173bb487bdf91
Ticket: 8e91ec4866db095f1d90d4e2fd468305a8a80bf8
{TCL LOOKUP VARNAME} vs {TCL READ VARNAME}
User & Date: aspect on 2015-07-23 05:29:56
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    I don't know what category to put this in - was hoping for something like "Exceptions".
    
    {TCL READ VARNAME} seems like a mistake - {TCL LOOKUP VARNAME} occurs more
    frequently in the source, and it is not clear to the script writer why one
    might trap one but not the other:
    
    % unset a
    % try {puts $a} on error {e o} {puts [dict get $o -errorcode]}
    TCL LOOKUP VARNAME a
    % apply {{} {try {puts $a} on error {e o} {puts [dict get $o -errorcode]}}}
    TCL READ VARNAME
    % try {apply {{} {puts $a}}} on error {e o} {puts [dict get $o -errorcode]}
    TCL READ VARNAME
    % try {puts $a(a)} on error {e o} {puts [dict get $o -errorcode]}
    TCL LOOKUP VARNAME a
    % array set a {}
    % try {puts $a(a)} on error {e o} {puts [dict get $o -errorcode]}
    TCL READ VARNAME
    
    Despite frequency of occurrence, READ seems to only be emitted from one location in
    the source:
    
    http://core.tcl.tk/tcl/artifact/0a01b4037e1d4eec?ln=1414
    
    Where it has been since:
    
    http://core.tcl.tk/tcl/info/a12728cbb91807a8
    
    While the test suite is mostly quite thorough with errors, it only touches
    {TCL * VARNAME} by accident, in cmdAH-23.6.  The above examples seem like a good
    start for test cases, but I'm not sure what others should exist.
    
  5. foundin changed to: "8.6"
  6. is_private changed to: "0"
  7. login: "aspect"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Minor"
  11. status changed to: "Open"
  12. submitter changed to: "aspect"
  13. subsystem changed to: "None"
  14. title changed to: "{TCL LOOKUP VARNAME} vs {TCL READ VARNAME}"
  15. type changed to: "Bug"