summaryrefslogtreecommitdiffhomepage
path: root/tcl.html.markdown
diff options
context:
space:
mode:
authorven <vendethiel@hotmail.fr>2015-08-26 23:05:47 +0200
committerven <vendethiel@hotmail.fr>2015-08-26 23:05:47 +0200
commit48ccfaed7296ef453f1db154fdce07c090754630 (patch)
tree5903eb48b9ef126d3a8321e47999b98351221268 /tcl.html.markdown
parentf6571d3c6bfd89f04b8c4f41d530f68b1d77929e (diff)
parent7d2339328d5bb2b0bd642809cd68a604d7d2a34d (diff)
Merge pull request #1213 from asfarley/master
[tcl/en] Updating line 167 to fix name resolution error at line 173.
Diffstat (limited to 'tcl.html.markdown')
-rw-r--r--tcl.html.markdown7
1 files changed, 5 insertions, 2 deletions
diff --git a/tcl.html.markdown b/tcl.html.markdown
index c1cd42ca..9ca32f1e 100644
--- a/tcl.html.markdown
+++ b/tcl.html.markdown
@@ -164,7 +164,7 @@ set greeting "Hello, $person(name)"
# A namespace holds commands and variables
namespace eval people {
namespace eval person1 {
- set name Neo
+ variable name Neo
}
}
@@ -190,7 +190,10 @@ set greeting "Hello $people::person1::name"
namespace delete ::
-# Because of name resolution behaviour, it's safer to use the "variable" command to declare or to assign a value to a namespace.
+# Because of name resolution behaviour, it's safer to use the "variable" command to
+# declare or to assign a value to a namespace. If a variable called "name" already
+# exists in the global namespace, using "set" here will assign a value to the global variable
+# instead of creating a new variable in the local namespace.
namespace eval people {
namespace eval person1 {
variable name Neo