Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Try to get all of your posthumous medals in advance.


comp / comp.lang.tcl / Re: tcllib1.21 and tcl9.0b3

SubjectAuthor
* tcllib1.21 and tcl9.0b3Alan Grunwald
+* Re: tcllib1.21 and tcl9.0b3Alan Grunwald
|`- Re: tcllib1.21 and tcl9.0b3Alan Grunwald
`* Re: tcllib1.21 and tcl9.0b3Paul Obermeier
 `* Re: tcllib1.21 and tcl9.0b3Alan Grunwald
  `- Re: tcllib1.21 and tcl9.0b3Paul Obermeier

1
Subject: tcllib1.21 and tcl9.0b3
From: Alan Grunwald
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Fri, 13 Sep 2024 23:13 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam.nurdglaw@gmail.com (Alan Grunwald)
Newsgroups: comp.lang.tcl
Subject: tcllib1.21 and tcl9.0b3
Date: Sat, 14 Sep 2024 00:13:13 +0100
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <vc2gvs$12u66$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 14 Sep 2024 01:14:05 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7428e04cfcb459dd44d282ad9aaa2244";
logging-data="1145030"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18E2bodLIGQfDAgLVyhpQJ9mRC+r5MBcXY="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:rqwGUWGZyKjNusCN/ss9iB1VdFk=
Content-Language: en-US
View all headers

How compatible is tcllib 1.21 with tcl9.0b3?

I've built tcl-9.0b3 and want to see how it plays with my scripts. (OK,
more properly that should be "how my scripts play with tcl 9.0b3.)

I'm testing with a script that includes [package require uri].

This fails, saying it can't find the package.

I've dug around a bit and I see that the pkgIndex.tcl in tcllib-1.21
starts with a fast return if

[package vsatisfies [package provide Tcl] 8]

returns 0.

I've changed that to

[package vsatisfies [package provide Tcl] 8 9]

and it now gets a couple of lines further down the script where it
encounters

if {(0 == [catch {
package vcompare [info patchlevel] [info patchlevel]
}]) && (
[package vcompare [info patchlevel] 8.3.1] >= 0
)} {return}

and returns.

I don't understand this line well enough to change it. As far as I can
make out,

package vcompare [info patchlevel] [info patchlevel]

will always return 0 and won't throw an exception, so this should always
result in a premature return, before all the

package ifneeded

commands for the packages withing tcllib are executed.

However, that argument applies equally to tcl8.6.14, but the same
pkgIndex.tcl works just fine on my home-built copy of that.

It's getting late and I'll have another look tomorrow and see if I can
work out what's happening. In the mean time, I'd very much appreciate
any help you can provide.

Subject: Re: tcllib1.21 and tcl9.0b3
From: Alan Grunwald
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 14 Sep 2024 15:37 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam.nurdglaw@gmail.com (Alan Grunwald)
Newsgroups: comp.lang.tcl
Subject: Re: tcllib1.21 and tcl9.0b3
Date: Sat, 14 Sep 2024 16:37:34 +0100
Organization: A noiseless patient Spider
Lines: 93
Message-ID: <vc4alh$1hk3o$1@dont-email.me>
References: <vc2gvs$12u66$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 14 Sep 2024 17:38:26 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7ea1899aff7fe76c47fad81fe00e640d";
logging-data="1626232"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+fve4VS21wEsRqPoBugX1iD7hSbBUPPyg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:UFcWSdM0aO++5BPu5QiCVwldS0g=
In-Reply-To: <vc2gvs$12u66$1@dont-email.me>
Content-Language: en-US
View all headers

On 14/09/2024 00:13, Alan Grunwald wrote:
> How compatible is tcllib 1.21 with tcl9.0b3?
>
> I've built tcl-9.0b3 and want to see how it plays with my scripts. (OK,
> more properly that should be "how my scripts play with tcl 9.0b3.)
>
> I'm testing with a script that includes [package require uri].
>
> This fails, saying it can't find the package.
>
> I've dug around a bit and I see that the pkgIndex.tcl in tcllib-1.21
> starts with a fast return if
>
> [package vsatisfies [package provide Tcl] 8]
>
> returns 0.
>
> I've changed that to
>
> [package vsatisfies [package provide Tcl] 8 9]
>
> and it now gets a couple of lines further down the script where it
> encounters
>
> if {(0 == [catch {
>     package vcompare [info patchlevel] [info patchlevel]
> }]) && (
>     [package vcompare [info patchlevel] 8.3.1] >= 0
> )} {return}
>
> and returns.
>
> I don't understand this line well enough to change it. As far as I can
> make out,
>
>     package vcompare [info patchlevel] [info patchlevel]
>
> will always return 0 and won't throw an exception, so this should always
> result in a premature return, before all the
>
> package ifneeded
>
> commands for the packages withing tcllib are executed.
>
> However, that argument applies equally to tcl8.6.14, but the same
> pkgIndex.tcl works just fine on my home-built copy of that.
>
> It's getting late and I'll have another look tomorrow and see if I can
> work out what's happening. In the mean time, I'd very much appreciate
> any help you can provide.

OK. I've had another look.

Between the line

if {[package vsatisfies [package provide Tcl] 8]} {return}

which I have changed to ...vstaisfies... 8 9, and the multi-line command
that I quoted above, are the lines

# For Tcl 8.3.1 and later, that's all we need
if {[package vsatisfies [package provide Tcl] 8.4]} {return}

I have confirmed that on Tcl 8.6.14, the return is executed, so I have
changed the second line to

if {[package vsatisfies [package provide Tcl] 8.4 9]} {return}

and the return is now executed on Tcl9.0b3. However,

package require uri

still fails with "can't find package uri"

As far as I can make out, this means that the package should be fund
using the [package unknown] mechanism.

In both version of Tcl, [package unknown] returns

{::tcl::tm::UnknownHandler ::tclPkgUnknown}

I assume that since uri should be provided as a good old-fashioned
package rather than a module, I can ignore ::tcl::tm::UnknownHandler.

::tclPkgUnknown appears to be unchanged between 8.6.14 and 9.0b3, apart
from a change in 9.0b3 to use the (undocumented) flag -nopkg when
executing [source] in a safe interpreter. Since my interpreter isn't
safe, I think that's irrelevant.

I'm going to try to get my head around ::tclPkgUnknown to try to track
down what has changed.

As before, any assistance would be very welcome.

Subject: Re: tcllib1.21 and tcl9.0b3
From: Paul Obermeier
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 14 Sep 2024 15:57 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: obermeier@poSoft.de (Paul Obermeier)
Newsgroups: comp.lang.tcl
Subject: Re: tcllib1.21 and tcl9.0b3
Date: Sat, 14 Sep 2024 17:57:26 +0200
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <vc4bpj$1hsh6$1@dont-email.me>
References: <vc2gvs$12u66$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 14 Sep 2024 17:57:40 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="4f60fca12f4f1e6b9a9fe0cccd990a54";
logging-data="1634854"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18srnKfXQZep/u7r30oX95MHV0GAZ5Mo/Q="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:uzoIrILwRYc7J5DApmCBt79nFKc=
In-Reply-To: <vc2gvs$12u66$1@dont-email.me>
View all headers

Am 14.09.2024 um 01:13 schrieb Alan Grunwald:
> How compatible is tcllib 1.21 with tcl9.0b3?
>
> I've built tcl-9.0b3 and want to see how it plays with my scripts. (OK, more properly that should be "how my scripts play with tcl 9.0b3.)
>
> I'm testing with a script that includes [package require uri].
>
> This fails, saying it can't find the package.
>
> I've dug around a bit and I see that the pkgIndex.tcl in tcllib-1.21 starts with a fast return if
>
> [package vsatisfies [package provide Tcl] 8]
>
> returns 0.
>
> I've changed that to
>
> [package vsatisfies [package provide Tcl] 8 9]
>
> and it now gets a couple of lines further down the script where it encounters
>
> if {(0 == [catch {
>     package vcompare [info patchlevel] [info patchlevel]
> }]) && (
>     [package vcompare [info patchlevel] 8.3.1] >= 0
> )} {return}
>
> and returns.
>
> I don't understand this line well enough to change it. As far as I can make out,
>
>     package vcompare [info patchlevel] [info patchlevel]
>
> will always return 0 and won't throw an exception, so this should always result in a premature return, before all the
>
> package ifneeded
>
> commands for the packages withing tcllib are executed.
>
> However, that argument applies equally to tcl8.6.14, but the same pkgIndex.tcl works just fine on my home-built copy of that.
>
> It's getting late and I'll have another look tomorrow and see if I can work out what's happening. In the mean time, I'd very much appreciate any help you can provide.

Hi Alan,

tcllib 1.21 is not Tcl9 ready.
You should try the current trunk of tcllib.
Andreas Kupries committed some more Tcl9 related changes just yesterday.

Also note, that there is a RC0 candidate of Tcl9 (https://sourceforge.net/projects/tcl/files/Tcl/9.0.0/)

Paul

Subject: Re: tcllib1.21 and tcl9.0b3
From: Alan Grunwald
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 14 Sep 2024 16:40 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam.nurdglaw@gmail.com (Alan Grunwald)
Newsgroups: comp.lang.tcl
Subject: Re: tcllib1.21 and tcl9.0b3
Date: Sat, 14 Sep 2024 17:40:37 +0100
Organization: A noiseless patient Spider
Lines: 111
Message-ID: <vc4ebo$1ikvr$1@dont-email.me>
References: <vc2gvs$12u66$1@dont-email.me> <vc4alh$1hk3o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 14 Sep 2024 18:41:29 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6c8352be7dabfb43f34160896f82b715";
logging-data="1659899"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/NPrj51iaTAW8Kk1DAdg3sW0Np8zNYfXY="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:nHLu3PVAyjC6eIljwB+oSCRgWUM=
In-Reply-To: <vc4alh$1hk3o$1@dont-email.me>
Content-Language: en-US
View all headers

On 14/09/2024 16:37, Alan Grunwald wrote:
> On 14/09/2024 00:13, Alan Grunwald wrote:
>> How compatible is tcllib 1.21 with tcl9.0b3?
>>
>> I've built tcl-9.0b3 and want to see how it plays with my scripts.
>> (OK, more properly that should be "how my scripts play with tcl 9.0b3.)
>>
>> I'm testing with a script that includes [package require uri].
>>
>> This fails, saying it can't find the package.
>>
>> I've dug around a bit and I see that the pkgIndex.tcl in tcllib-1.21
>> starts with a fast return if
>>
>> [package vsatisfies [package provide Tcl] 8]
>>
>> returns 0.
>>
>> I've changed that to
>>
>> [package vsatisfies [package provide Tcl] 8 9]
>>
>> and it now gets a couple of lines further down the script where it
>> encounters
>>
>> if {(0 == [catch {
>>      package vcompare [info patchlevel] [info patchlevel]
>> }]) && (
>>      [package vcompare [info patchlevel] 8.3.1] >= 0
>> )} {return}
>>
>> and returns.
>>
>> I don't understand this line well enough to change it. As far as I can
>> make out,
>>
>>      package vcompare [info patchlevel] [info patchlevel]
>>
>> will always return 0 and won't throw an exception, so this should
>> always result in a premature return, before all the
>>
>> package ifneeded
>>
>> commands for the packages withing tcllib are executed.
>>
>> However, that argument applies equally to tcl8.6.14, but the same
>> pkgIndex.tcl works just fine on my home-built copy of that.
>>
>> It's getting late and I'll have another look tomorrow and see if I can
>> work out what's happening. In the mean time, I'd very much appreciate
>> any help you can provide.
>
> OK. I've had another look.
>
> Between the line
>
>     if {[package vsatisfies [package provide Tcl] 8]} {return}
>
> which I have changed to ...vstaisfies... 8 9, and the multi-line command
> that I quoted above, are the lines
>
>     # For Tcl 8.3.1 and later, that's all we need
>     if {[package vsatisfies [package provide Tcl] 8.4]} {return}
>
> I have confirmed that on Tcl 8.6.14, the return is executed, so I have
> changed the second line to
>
>     if {[package vsatisfies [package provide Tcl] 8.4 9]} {return}
>
> and the return is now executed on Tcl9.0b3. However,
>
>     package require uri
>
> still fails with "can't find package uri"
>
> As far as I can make out, this means that the package should be fund
> using the [package unknown] mechanism.
>
> In both version of Tcl, [package unknown] returns
>
>     {::tcl::tm::UnknownHandler ::tclPkgUnknown}
>
> I assume that since uri should be provided as a good old-fashioned
> package rather than a module, I can ignore ::tcl::tm::UnknownHandler.
>
> ::tclPkgUnknown appears to be unchanged between 8.6.14 and 9.0b3, apart
> from a change in 9.0b3 to use the (undocumented) flag -nopkg when
> executing [source] in a safe interpreter. Since my interpreter isn't
> safe, I think that's irrelevant.
>
> I'm going to try to get my head around ::tclPkgUnknown to try to track
> down what has changed.
>
> As before, any assistance would be very welcome.
Hey ho.

I had a look on the wiki and found
https://wiki.tcl-lang.org/page/Porting+extensions+to+Tcl+9#40a2085371b8effbae526101c0fd639a2ed6604c16513802a0e05bd3d9b8e1b0
which includes a table listing packages that have been ported. The table
includes tcllib 2.0 pointing to
https://www.tcl3d.org/bawt/download/InputLibs/tcllib-2.0.7z

I've added tcllib 2.0 to my tcl9.0b3 installation and it passes my crude
test, i.e.

package require uri

completes successfully.

Thanks to anyone who has been reading.

Subject: Re: tcllib1.21 and tcl9.0b3
From: Alan Grunwald
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 14 Sep 2024 16:46 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam.nurdglaw@gmail.com (Alan Grunwald)
Newsgroups: comp.lang.tcl
Subject: Re: tcllib1.21 and tcl9.0b3
Date: Sat, 14 Sep 2024 17:46:47 +0100
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <vc4enq$1ip3g$1@dont-email.me>
References: <vc2gvs$12u66$1@dont-email.me> <vc4bpj$1hsh6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 14 Sep 2024 18:47:55 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a69429225a3ea6efcadbeae6895de46e";
logging-data="1664112"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+uBNrWYY0v3bQi4l2lHb2mdUC9JBLAAig="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:vzssTj/ymLnK+DRnzqI8r3tFUUo=
Content-Language: en-US
In-Reply-To: <vc4bpj$1hsh6$1@dont-email.me>
View all headers

On 14/09/2024 16:57, Paul Obermeier wrote:
> Am 14.09.2024 um 01:13 schrieb Alan Grunwald:
>> How compatible is tcllib 1.21 with tcl9.0b3?
>>
>> I've built tcl-9.0b3 and want to see how it plays with my scripts.
>> (OK, more properly that should be "how my scripts play with tcl 9.0b3.)
>>
>> I'm testing with a script that includes [package require uri].
>>
>> This fails, saying it can't find the package.
>>
>> I've dug around a bit and I see that the pkgIndex.tcl in tcllib-1.21
>> starts with a fast return if
>>
>> [package vsatisfies [package provide Tcl] 8]
>>
>> returns 0.
>>
>> I've changed that to
>>
>> [package vsatisfies [package provide Tcl] 8 9]
>>
>> and it now gets a couple of lines further down the script where it
>> encounters
>>
>> if {(0 == [catch {
>>      package vcompare [info patchlevel] [info patchlevel]
>> }]) && (
>>      [package vcompare [info patchlevel] 8.3.1] >= 0
>> )} {return}
>>
>> and returns.
>>
>> I don't understand this line well enough to change it. As far as I can
>> make out,
>>
>>      package vcompare [info patchlevel] [info patchlevel]
>>
>> will always return 0 and won't throw an exception, so this should
>> always result in a premature return, before all the
>>
>> package ifneeded
>>
>> commands for the packages withing tcllib are executed.
>>
>> However, that argument applies equally to tcl8.6.14, but the same
>> pkgIndex.tcl works just fine on my home-built copy of that.
>>
>> It's getting late and I'll have another look tomorrow and see if I can
>> work out what's happening. In the mean time, I'd very much appreciate
>> any help you can provide.
>
>
> Hi Alan,
>
> tcllib 1.21 is not Tcl9 ready.
> You should try the current trunk of tcllib.
> Andreas Kupries committed some more Tcl9 related changes just yesterday.
>
> Also note, that there is a RC0 candidate of Tcl9
> (https://sourceforge.net/projects/tcl/files/Tcl/9.0.0/)
>
> Paul
>
>
Thanks Paul - I've just spotted a reference to tcllib 2.0 on the wiki;
see a message in a sibling thread.

I think I'll press on with 9.0b3 and hope to get that going happily just
before 9.0 hits the streets :-). Where is the tcllib repo?

Alan

Subject: Re: tcllib1.21 and tcl9.0b3
From: Paul Obermeier
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sat, 14 Sep 2024 17:12 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: obermeier@poSoft.de (Paul Obermeier)
Newsgroups: comp.lang.tcl
Subject: Re: tcllib1.21 and tcl9.0b3
Date: Sat, 14 Sep 2024 19:12:25 +0200
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <vc4g66$1j09j$1@dont-email.me>
References: <vc2gvs$12u66$1@dont-email.me> <vc4bpj$1hsh6$1@dont-email.me>
<vc4enq$1ip3g$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 14 Sep 2024 19:12:39 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="4f60fca12f4f1e6b9a9fe0cccd990a54";
logging-data="1671475"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Ic1dqS3QSQrbUF3lOSWEatbD2frYpjiQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Mm55T1YU+vZxiblGpMZAEVZv9KU=
In-Reply-To: <vc4enq$1ip3g$1@dont-email.me>
View all headers

Am 14.09.2024 um 18:46 schrieb Alan Grunwald:
> On 14/09/2024 16:57, Paul Obermeier wrote:
>> Am 14.09.2024 um 01:13 schrieb Alan Grunwald:
>>> How compatible is tcllib 1.21 with tcl9.0b3?
>>>
>>> I've built tcl-9.0b3 and want to see how it plays with my scripts. (OK, more properly that should be "how my scripts play with tcl 9.0b3.)
>>>
>>> I'm testing with a script that includes [package require uri].
>>>
>>> This fails, saying it can't find the package.
>>>
>>> I've dug around a bit and I see that the pkgIndex.tcl in tcllib-1.21 starts with a fast return if
>>>
>>> [package vsatisfies [package provide Tcl] 8]
>>>
>>> returns 0.
>>>
>>> I've changed that to
>>>
>>> [package vsatisfies [package provide Tcl] 8 9]
>>>
>>> and it now gets a couple of lines further down the script where it encounters
>>>
>>> if {(0 == [catch {
>>>      package vcompare [info patchlevel] [info patchlevel]
>>> }]) && (
>>>      [package vcompare [info patchlevel] 8.3.1] >= 0
>>> )} {return}
>>>
>>> and returns.
>>>
>>> I don't understand this line well enough to change it. As far as I can make out,
>>>
>>>      package vcompare [info patchlevel] [info patchlevel]
>>>
>>> will always return 0 and won't throw an exception, so this should always result in a premature return, before all the
>>>
>>> package ifneeded
>>>
>>> commands for the packages withing tcllib are executed.
>>>
>>> However, that argument applies equally to tcl8.6.14, but the same pkgIndex.tcl works just fine on my home-built copy of that.
>>>
>>> It's getting late and I'll have another look tomorrow and see if I can work out what's happening. In the mean time, I'd very much appreciate any help you can provide.
>>
>>
>> Hi Alan,
>>
>> tcllib 1.21 is not Tcl9 ready.
>> You should try the current trunk of tcllib.
>> Andreas Kupries committed some more Tcl9 related changes just yesterday.
>>
>> Also note, that there is a RC0 candidate of Tcl9 (https://sourceforge.net/projects/tcl/files/Tcl/9.0.0/)
>>
>> Paul
>>
>>
> Thanks Paul - I've just spotted a reference to tcllib 2.0 on the wiki; see a message in a sibling thread.
>
> I think I'll press on with 9.0b3 and hope to get that going happily just before 9.0 hits the streets :-). Where is the tcllib repo?

It's here: https://core.tcl-lang.org/tcllib/doc/trunk/embedded/index.md

> Alan

1

rocksolid light 0.9.8
clearnet tor