Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-09-05
05:47 • Ticket [458548ffff] proc allows :: in arg names status still Closed with 4... artifact: 070af868f6 user: msofer
05:47 • Add attachment 458548.patch to ticket [458548ffff] artifact: 81a15a5782 user: msofer
05:47 • Closed ticket [458548ffff]: proc allows :: in arg names plus 7 other chang... artifact: 92efb6fa47 user: msofer
05:15 • Ticket [458548ffff]: 4 changes artifact: 993d96ab1b user: dgp
2001-09-04
22:11 • New ticket [458548ffff]. artifact: c40ad5c1fb user: kennykb

[proc] allows :: in arg names

Closed / Fixed458548ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2001-09-04 22:11:08
The [proc] command allows namespace qualifiers in arg names:

proc x ::y { puts [info locals] } ; x z

The resulting variables cannot be accessed because any attempt to use
either [set] or $ substitution will search some namespace for them, rather
than looking for locals.

[proc] shouldn't allow namespace-qualified names.
dgpplain2001-09-05 05:15:39
Logged In: YES 
user_id=80530


This can also lead to confusion when the
argument containing namespace separators
just happens to have the same name as
an actual namespace variable:

namespace eval one {
    proc foo two::x {
        set two::x
    }
}

puts "[catch {one::foo 1} msg] $msg"

namespace eval one::two {
    variable x 2
}

puts "[catch {one::foo 1} msg] $msg"
msoferplain2001-09-05 05:47:26
Logged In: YES 
user_id=148712

The attached patch fixes the bug; committed to HEAD.
msoferplain2001-09-05 05:47:27
File Added - 10382: 458548.patch
Log in (anonymous is fine) to add a comment.

Attachments: