Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2009-11-27
13:39 • Closed ticket [2903811fff]: oo::object->variable working wrong plus 7 oth... artifact: ccb3ab2127 user: dkf
2009-11-25
23:27 • Ticket [2903811fff]: 1 change artifact: 1f457240b6 user: dkf
15:45 • New ticket [2903811fff]. artifact: 56b87ea0df user: dkf

oo::object->variable working wrong

Closed / Fixed2903811fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2009-11-25 15:45:50
The following script fails:
  oo::object create obj
  oo::objdefine obj export variable
  proc foo o {o variable x; set x OK}
  proc bar o {o variable x; return $x}
  foo obj; bar obj
Reading the documentation in the object(n) manual page would not lead you to this conclusion. The problem appears to be a guard inside the implementation that makes the method only work inside the body of a method instead of any normal stack context (like [global]). Arguably, it might even be beneficial to allow it to work in namespaces...
dkf Ticket [2903811fff]: 1 change [History diff]2009-11-25 23:27:12
dkfplain2009-11-27 13:39:28
allow_comments - 1
Log in (anonymous is fine) to add a comment.