Tcl Source Code

Ticket Change Details
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.
Overview

Artifact ID: f1457e894220a9584b3fdf83f8f9608a032c52d53e85d1e88e50a83ad88112ce
Ticket: 2d2a32124406e8494a9d73cf2b668dcddc75fdf6
info frame does not correct recognize current type of execution scope
User & Date: sebres 2019-03-15 14:18:16
Changes

  1. Change assignee to "nobody"
  2. Change closer to "nobody"
  3. Change cmimetype to "text/x-fossil-wiki"
  4. Change comment to:

    If frame level is provided as value, it is confused:

    % proc test {} { puts pr:[info frame [info frame]]; namespace eval ::test {puts ns:[info frame [info frame]]} }; test
      pr:type proc line 1 cmd {info frame [info frame]} proc ::test level 0
      ns:type proc line 1 cmd {info frame [info frame]} level 0
    
    totally unexpected type (red marked), imho - should not type be something like "eval" or "namespace" in the second case?

    If one gives the 0 (so as current frame level), it works correct:

    % proc test {} { puts pr:[info frame 0]; namespace eval ::test {puts ns:[info frame 0]} }; test
      pr:type proc line 1 cmd {info frame 0} proc ::test level 0
      ns:type eval line 1 cmd {info frame 0} level 0
    

    But still worse, the things change also in this case if something else is involved around `info frame` additionally.
    So adding a `dict get ... type` around confuses it again:

    % proc test {} { puts pr:[dict get [info frame 0] type]; namespace eval ::test {puts ns:[dict get [info frame 0] type]} }; test
      pr:proc
      ns:proc
    
    As well as just usage of set, so set to variable (despite it is compiled in NS) causes completely wrong type recognition:
    % proc test {} { namespace eval ::test {puts ns:[info frame 0]} }; test
      ns:type eval line 1 cmd {info frame 0} level 0
    % proc test {} { namespace eval ::test {puts ns:[set f [info frame 0]]} }; test
      ns:type proc line 1 cmd {info frame 0} level 0
    

    So it looks like `info frame` is totally unusable at the moment (or at least pointing at the wrong frame, if one wants to retrieve the type of the scope).

  5. Change foundin to "all"
  6. Change is_private to "0"
  7. Change login to "sebres"
  8. Change priority to "5 Medium"
  9. Change resolution to "None"
  10. Change severity to "Severe"
  11. Change status to "Open"
  12. Change submitter to "sebres"
  13. Change subsystem to "16. Commands A-H"
  14. Change title to:

    info frame does not correct recognize current type of execution scope

  15. Change type to "Bug"