Groups | Search | Server Info | Login | Register


Groups > comp.lang.tcl > #55504

Re: variable ../.. global

From Roderick <hruodr@gmail.com>
Newsgroups comp.lang.tcl
Subject Re: variable ../.. global
Date 2026-02-25 07:10 +0000
Organization MB-NET.NET for Open-News-Network e.V.
Message-ID <f8a23111-2ac1-b4e3-2252-6cf7631faa06@gmail.com> (permalink)
References (1 earlier) <10ng392$2hbg4$1@dont-email.me> <50978edb-fbd0-2c16-cacb-e5c7557bc279@gmail.com> <10nghou$2lbjj$1@dont-email.me> <90732c48-bc1c-ddab-7c22-c6ac877b664f@gmail.com> <10niage$394up$1@dont-email.me>

Show all headers | View raw


On Mon, 23 Feb 2026, Rich wrote:

> Continue with a test of a non-existant namespace:
>
>    % namespace eval nn2 {proc pp2 {} {global ::nn3::v; set v 1}}
>    % set nn3::v
>    can't read "nn3::v": no such variable
>    % nn2::pp2
>    can't access "::nn3::v": parent namespace doesn't exist


# tclsh
% global ::nn3::v
% % set ::nn3::v 1
invalid command name "%"
% variable ::nn3::v
can't define "::nn3::v": parent namespace doesn't exis

I think, that is a difference between global and variable.
The last do allocate memory, the first only signalizes that
a local var in procedure is bound to other var that perhaps
does not exist yet.

Back to comp.lang.tcl | Previous | NextPrevious in thread | Next 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