TCLの変数スコープについて質問があります。次のコードがあります。
namespace eval ::hello {
variable player
variable name
namespace export *
}
proc ::hello::setPlay {value} {
set ::hello::player
}
proc ::hello::getPlay {} {
return $::hello::player
}
proc ::hello::setName {value} {
set ::hello::name
}
proc ::hello::getName {} {
return $::hello::name
}
proc GET_NAME {} {
#here I have a variable called name as well
set name "RON"
return $name
}
GET_NAMEで、変数名を「RON」に設定すると、名前空間でdeclairedされた変数名が設定されますか?GET_NAMEと名前空間に同じ変数名を付けることはできますか?そして、この行variable name
をGET_NAMEに追加すると、これは、名前空間でdeclairedされた変数を設定することを意味しますか?