Path: csiph.com!news.swapon.de!news.mb-net.net!open-news-network.org!.POSTED!not-for-mail From: Roderick Newsgroups: comp.lang.tcl Subject: Re: variable ../.. global Date: Mon, 23 Feb 2026 09:14:00 +0000 Organization: MB-NET.NET for Open-News-Network e.V. Message-ID: References: <81ab5038-2ab4-59ae-6058-561da5cf8e92@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Injection-Info: gwaiyur.mb-net.net; logging-data="693652"; mail-complaints-to="abuse@open-news-network.org" Cancel-Lock: sha1:2rO03FvdSrdQj0iqusrZxVqVmHc= sha256:4LAtGcWwHs/AOek8R17JuPtTktTrvw2B53+5nvN42sY= sha1:xTq2lLEc02AhwpMCYpIrqNymPmA= sha256:71m18D/GH1nlRYmvK2uMFwje5F7hCQKv8NU1H0Shyb4= In-Reply-To: Xref: csiph.com comp.lang.tcl:55492 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. > >