Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2009-10-02
02:13 • Closed ticket [1881284fff]: variable should cope with no arguments plus 8 ... artifact: a9077786c3 user: dgp
02:13 • Ticket [1881284fff]: 4 changes artifact: 8bb5eff013 user: dgp
2008-11-07
16:54 • Ticket [1881284fff]: 4 changes artifact: f6b7189fee user: nijtmans
2008-08-06
19:40 • Ticket [1881284fff]: 4 changes artifact: 17bf122d3b user: msofer
2008-06-30
01:29 • Ticket [1881284fff]: 4 changes artifact: 7ee78bdc22 user: dgp
2008-06-29
07:03 • Ticket [1881284fff]: 4 changes artifact: 55e52e15dc user: coldstore
2008-06-28
23:04 • Ticket [1881284fff]: 4 changes artifact: cdb831ce11 user: msofer
2008-01-29
15:56 • Ticket [1881284fff]: 2 changes artifact: e940ab8be3 user: dkf
2008-01-28
17:12 • New ticket [1881284fff]. artifact: 62e030777b user: coldstore

[variable] should cope with no arguments

Closed / Accepted1881284fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 17 years ago
Descriptionplain2008-01-28 17:12:17
By analogy with 1671880 [variable] should be modified to permit no arguments.

This enhancement would be useful for the following idioms:
dkf Ticket [1881284fff]: 2 changes [History diff]2008-01-29 15:56:57
msoferplain2008-06-28 23:04:12
Logged In: YES 
user_id=148712
Originator: NO

messagw truncated: which idioms?
coldstoreplain2008-06-29 07:03:02
Logged In: YES 
user_id=19214
Originator: YES

proc foo {args} {
  variable {*}$args
}

is the idiom I was thinking of.
dgpplain2008-06-30 01:29:34
Logged In: YES 
user_id=80530
Originator: NO


Since [variable] takes alternating
arguments to represent varname and values,
I think the idiom is:

proc foo {dict} {
    variable {*}$dict
}
msoferplain2008-08-06 19:40:29
Logged In: YES 
user_id=148712
Originator: NO

This looks like a valuable RFE to me, I'd even extend it to [global], [upvar], [namespace upvar]. But it does require a simple TIP, as the docs (and tests) need changing.
nijtmansplain2008-11-07 16:54:00
Isn't this already done in the TIP #323 implementation?
dgpplain2009-10-02 02:13:37
this is done.
dgpplain2009-10-02 02:13:41
allow_comments - 1
Log in (anonymous is fine) to add a comment.