Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 725670686cf7fccdd2980d3d92a7407a748a9407
Ticket: 1367486fffffffffffffffffffffffffffffffff
Unexpected error when aliasing undefined command
User & Date: msofer on 2005-11-27 19:37:40
Changes

  1. assignee changed to: "msofer"
  2. closedate changed to: "2005-11-27T12:37:40"
  3. closer changed to: "msofer"
  4. icomment:
    Logged In: YES 
    user_id=148712
    
    This is not really a bug, and [interp alias] has nothing to
    do with it. It is the autocompletion in the interactive
    tclsh playing tricks on you. Look at the following session:
    
      % interp alias {} xxx {} xx
      xxx
      % xx
      too many nested evaluations (infinite loop?)
      % proc xxAHA! {} {}
      % xx
      ambiguous command name "xx": xxAHA! xxx
    
    What is happening in your case is:
      (1) you invoke a command named xx (directly)
      (2) no such command; autocompletion sees that there is a
    unique command (xxx) starting with xx, and invokes it
      (3) xxx invokes xx: goto 1.
    
    Note also that you see the correct error if the script is
    sourced from a file, as the autocompletion does not work in
    that case:
    
    mig@uhu:~$ cat /tmp/test
    interp alias {} xxx {} xx
    xx
    mig@uhu:~$ tclsh /tmp/test
    invalid command name "xx"
        while executing
    "xx"
        (file "/tmp/test" line 2)
    
    
    
  5. login: "msofer"
  6. mimetype: "text/plain"
  7. resolution changed to: "Invalid"
  8. status changed to: "Closed"
  9. username: "msofer"