Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.tcl > #55491
| From | Roderick <hruodr@gmail.com> |
|---|---|
| Newsgroups | comp.lang.tcl |
| Subject | Re: variable ../.. global |
| Date | 2026-02-23 09:08 +0000 |
| Organization | MB-NET.NET for Open-News-Network e.V. |
| Message-ID | <90732c48-bc1c-ddab-7c22-c6ac877b664f@gmail.com> (permalink) |
| References | <81ab5038-2ab4-59ae-6058-561da5cf8e92@gmail.com> <10ng392$2hbg4$1@dont-email.me> <50978edb-fbd0-2c16-cacb-e5c7557bc279@gmail.com> <10nghou$2lbjj$1@dont-email.me> |
On Mon, 23 Feb 2026, Rich wrote:
>> If I have a variable v in the namespace name, then
>>
>> "global ::name::v" and "variable v" inside a procedure in
>> "namespace eval name" will do the same.
>
> The point of "global" is to make a "local proc variable" link to a global
> of the same name. ::name::v is not a "local proc variable". Trying to
> do that won't make the link.
I meant this:
% namespace eval nn {proc pp {} {global ::nn::v; set v 1}}
% nn::pp
1
% set nn::v
1
Back to comp.lang.tcl | Previous | Next — Previous in thread | Next in thread | Find similar
variable ../.. global Roderick <hruodr@gmail.com> - 2026-02-22 22:57 +0000
Re: variable ../.. global Rich <rich@example.invalid> - 2026-02-22 23:25 +0000
Re: variable ../.. global Roderick <hruodr@gmail.com> - 2026-02-23 00:09 +0000
Re: variable ../.. global Rich <rich@example.invalid> - 2026-02-23 03:32 +0000
Re: variable ../.. global Roderick <hruodr@gmail.com> - 2026-02-23 09:08 +0000
Re: variable ../.. global Rich <rich@example.invalid> - 2026-02-23 19:41 +0000
Re: variable ../.. global Roderick <hruodr@gmail.com> - 2026-02-25 07:10 +0000
Re: variable ../.. global Rich <rich@example.invalid> - 2026-02-25 16:07 +0000
Re: variable ../.. global Schelte <nospam@wanadoo.nl> - 2026-02-23 09:51 +0100
Re: variable ../.. global Roderick <hruodr@gmail.com> - 2026-02-23 09:14 +0000
csiph-web