Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

God requireth not a uniformity of religion. -- Roger Williams


devel / comp.lang.tcl / Re: set var in interactive tclsh vs set var in a script

SubjectAuthor
* set var in interactive tclsh vs set var in a scriptOleg Nemanov
`* Re: set var in interactive tclsh vs set var in a scriptHarald Oehlmann
 `- Re: set var in interactive tclsh vs set var in a scriptOleg Nemanov

1
set var in interactive tclsh vs set var in a script

<8c64bd15-2aff-4860-8929-38d65e530648n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19228&group=comp.lang.tcl#19228

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:6214:2aab:b0:446:4053:7a2b with SMTP id js11-20020a0562142aab00b0044640537a2bmr16294260qvb.127.1650982537899;
Tue, 26 Apr 2022 07:15:37 -0700 (PDT)
X-Received: by 2002:a05:6870:1781:b0:e2:f30d:3a6c with SMTP id
r1-20020a056870178100b000e2f30d3a6cmr9574818oae.142.1650982537282; Tue, 26
Apr 2022 07:15:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Tue, 26 Apr 2022 07:15:37 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=194.190.114.28; posting-account=RPJNegoAAAAUgD_yLdrci9D1ZtZ1oI0L
NNTP-Posting-Host: 194.190.114.28
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8c64bd15-2aff-4860-8929-38d65e530648n@googlegroups.com>
Subject: set var in interactive tclsh vs set var in a script
From: oleg.o.nemanov@gmail.com (Oleg Nemanov)
Injection-Date: Tue, 26 Apr 2022 14:15:37 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 16
 by: Oleg Nemanov - Tue, 26 Apr 2022 14:15 UTC

Hi, all.

I can't understand why in interactive tclsh a var has more refcount, then
in a script:

~$ cat t.tcl
set a [list 1 2]
puts [::tcl::unsupported::representation $a]
~$ tclsh t.tcl
value is a list with a refcount of 2, object pointer at 0x55e14c5c0f90, internal representation 0x55e14c5ce140:(nil), no string representation
~$ tclsh
% set a [list 1 2]
1 2
% puts [::tcl::unsupported::representation $a]
value is a list with a refcount of 3, object pointer at 0x55c8e66ab140, internal representation 0x55c8e66c2ae0:(nil), string representation "1 2"
%

Re: set var in interactive tclsh vs set var in a script

<t494gc$ams$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19231&group=comp.lang.tcl#19231

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: wortkarg2@yahoo.de (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: set var in interactive tclsh vs set var in a script
Date: Tue, 26 Apr 2022 17:52:44 +0200
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <t494gc$ams$1@dont-email.me>
References: <8c64bd15-2aff-4860-8929-38d65e530648n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Apr 2022 15:52:44 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="53974ccff2876c2789abf655054667c1";
logging-data="10972"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18GHJ9Yy1Rzr55SyIG0b7dp"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.8.0
Cancel-Lock: sha1:3vfupiGix/Hl2T7Z8kcRR5k9ksM=
In-Reply-To: <8c64bd15-2aff-4860-8929-38d65e530648n@googlegroups.com>
Content-Language: en-GB
 by: Harald Oehlmann - Tue, 26 Apr 2022 15:52 UTC

Am 26.04.2022 um 16:15 schrieb Oleg Nemanov:
> Hi, all.
>
> I can't understand why in interactive tclsh a var has more refcount, then
> in a script:
>
> ~$ cat t.tcl
> set a [list 1 2]
> puts [::tcl::unsupported::representation $a]
> ~$ tclsh t.tcl
> value is a list with a refcount of 2, object pointer at 0x55e14c5c0f90, internal representation 0x55e14c5ce140:(nil), no string representation
> ~$ tclsh
> % set a [list 1 2]
> 1 2
> % puts [::tcl::unsupported::representation $a]
> value is a list with a refcount of 3, object pointer at 0x55c8e66ab140, internal representation 0x55c8e66c2ae0:(nil), string representation "1 2"
> %
>

Dear Oleg,
that is due to the history package.
Each interactive result value is stored in the history.
This increases the ref count.

Hope this helps,
Harald

Re: set var in interactive tclsh vs set var in a script

<e9b0d587-8f08-4ee3-97f2-47cac0293c34n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19258&group=comp.lang.tcl#19258

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:622a:15d1:b0:2f3:4dad:9f4 with SMTP id d17-20020a05622a15d100b002f34dad09f4mr18385039qty.287.1651653192577;
Wed, 04 May 2022 01:33:12 -0700 (PDT)
X-Received: by 2002:a05:6870:51cb:b0:e2:aafb:cbb9 with SMTP id
b11-20020a05687051cb00b000e2aafbcbb9mr3315984oaj.39.1651653192348; Wed, 04
May 2022 01:33:12 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Wed, 4 May 2022 01:33:12 -0700 (PDT)
In-Reply-To: <t494gc$ams$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=194.190.114.28; posting-account=RPJNegoAAAAUgD_yLdrci9D1ZtZ1oI0L
NNTP-Posting-Host: 194.190.114.28
References: <8c64bd15-2aff-4860-8929-38d65e530648n@googlegroups.com> <t494gc$ams$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e9b0d587-8f08-4ee3-97f2-47cac0293c34n@googlegroups.com>
Subject: Re: set var in interactive tclsh vs set var in a script
From: oleg.o.nemanov@gmail.com (Oleg Nemanov)
Injection-Date: Wed, 04 May 2022 08:33:12 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 8
 by: Oleg Nemanov - Wed, 4 May 2022 08:33 UTC

вторник, 26 апреля 2022 г. в 18:52:48 UTC+3, Harald Oehlmann:
> Dear Oleg,
> that is due to the history package.
> Each interactive result value is stored in the history.
> This increases the ref count.

Thanks for the info! This helped me solve my problem :-).


devel / comp.lang.tcl / Re: set var in interactive tclsh vs set var in a script

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor