Groups | Search | Server Info | Login | Register


Groups > comp.lang.tcl > #55492

Re: variable ../.. global

From Roderick <hruodr@gmail.com>
Newsgroups comp.lang.tcl
Subject Re: variable ../.. global
Date 2026-02-23 09:14 +0000
Organization MB-NET.NET for Open-News-Network e.V.
Message-ID <a4635bf6-5bbc-1197-abc0-86c2659b1521@gmail.com> (permalink)
References <81ab5038-2ab4-59ae-6058-561da5cf8e92@gmail.com> <nnd$2ba076d3$4c080b57@35ab83249013c5ae>

Show all headers | View raw


Terrible, that looks like a bug.

On Mon, 23 Feb 2026, Schelte wrote:

> On 22/02/2026 23:57, Roderick wrote:
>> What is the difference between:
>> 
>> namespace eval foo {variable bar 12345}
>> 
>> and
>> 
>> namespace eval foo {set bar 12345}
>> 
>> Do not create both namespace variable?
>
> On Tcl 8 it depends. If there is already a global variable "bar", your second 
> command will change the value of the global variable, rather than create a 
> namespace variable:
>
> % set bar 42
> 42
> % namespace eval foo {set bar 12345}
> 12345
> % set bar
> 12345
> % info exists ::foo::bar
> 0
>
> See tip #278: https://core.tcl-lang.org/tips/doc/trunk/tip/278.md
>
>
> Schelte.
>
>

Back to comp.lang.tcl | Previous | NextPrevious in thread | Find similar


Thread

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