Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b76c95893e54615c938759f2fa625f0565e384726db17d284f8ceab8cac9e9b3
Ticket: 0e4b7fce57ddc428e5fab63a237e43c039be428b
Running [info vars] in a namespace returns global variables
User & Date: sbron on 2024-07-14 13:20:29
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. comment changed to:
    Running `info vars` in a fresh namespace in Tcl 9 reports the same list of variables that Tcl 8.6 does; the existing global variables.
    
    However, since [TIP #278](https://core.tcl-lang.org/tips/doc/trunk/tip/278.md) was implemented, global variables are no longer directly visible from within a namespace. They can only be accessed using their fully qualified names. It is therefor unexpected that `info vars` still reports them, especially by their simple name.
    
    I also don't think the globals should be reported by `info vars` using their fully qualified name, because all variables can be accessed using their fully qualified names. Then, if globals are included that way, then all variables in all namespaces should be included. That would quickly become a mess.
    
  5. foundin changed to: "9.0b2"
  6. is_private changed to: "0"
  7. login: "sbron"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "8475f421649231f1e116ac602bea4537d2b027b4"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "sbron"
  14. subsystem changed to: "07. Variables"
  15. title changed to:
    Running [info vars] in a namespace returns global variables
    
  16. type changed to: "Bug"