Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Can't open /usr/share/games/fortunes/fortunes.dat.


devel / comp.lang.tcl / Where is the documentation for pkgIndex.tcl files?

SubjectAuthor
* Where is the documentation for pkgIndex.tcl files?Luc
+- Re: Where is the documentation for pkgIndex.tcl files?Peter Dean
+- Re: Where is the documentation for pkgIndex.tcl files?rene
`* Re: Where is the documentation for pkgIndex.tcl files?Don Porter
 `* Re: Where is the documentation for pkgIndex.tcl files?Luc
  +* Re: Where is the documentation for pkgIndex.tcl files?Gerald Lester
  |`* Re: Where is the documentation for pkgIndex.tcl files?Luc
  | `* Re: Where is the documentation for pkgIndex.tcl files?Gerald Lester
  |  `* Re: Where is the documentation for pkgIndex.tcl files?Luc
  |   `* Re: Where is the documentation for pkgIndex.tcl files?Andreas Leitgeb
  |    `- Re: Where is the documentation for pkgIndex.tcl files?Luc
  `* Re: Where is the documentation for pkgIndex.tcl files?et99
   `- Re: Where is the documentation for pkgIndex.tcl files?Luc

1
Where is the documentation for pkgIndex.tcl files?

<20240312135747.47f720b7@lud1.home>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13537&group=comp.lang.tcl#13537

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Where is the documentation for pkgIndex.tcl files?
Date: Tue, 12 Mar 2024 13:57:47 -0300
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <20240312135747.47f720b7@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="3eba13d7d0bac29353763c3785b8bfa5";
logging-data="428221"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+NdTSYeo3c0a4VCtrMgfLQJiecxoE4Zc8="
Cancel-Lock: sha1:ZLHx3AxDXk8nGfScOZiDxsy4PAs=
 by: Luc - Tue, 12 Mar 2024 16:57 UTC

I made my very first package today and I hated that part.

See what the wiki says:

https://wiki.tcl-lang.org/page/pkg_mkIndex

pyk 2012-11-02 - dgp stated on the irc channel today that pkg_mkIndex
is not generally a good idea. It can't possibly solve the problem
right for any but the most simple packages, and even for those, typing
the index script yourself is just as easy.

"Just as easy"? I don't think so. What am I supposed to type? Where is
that documented? I spent a long time looking for that information and
couldn't find it.

pkg_mkIndex is bad indeed. My package has one, a single one .tcl file,
and pkg_mkIndex kept producing an empty pkgIndex.tcl file. In one of
many many many attempts, it generated something I could use and I just
went with it.

Of course I looked at other packages, but it's hard to make heads and
tails of the information they contain.

"Think of pkg_mkIndex as at best a (poor) tool to help you write
pkgIndex.tcl files. If you can do a better job by hand (or by template
substitution during configure) then that is probably better."
-- dkf ,tcl-core mailing list, 2012-11-07

OK, I wouldn't mind typing it all manually if only I had a clue of
what is supposed to go in a pkgIndex.tcl file. I swear, I searched
high and low and couldn't find it. Do you people know where that
information is found?

--
Luc
>>

Re: Where is the documentation for pkgIndex.tcl files?

<usqpel$if44$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13539&group=comp.lang.tcl#13539

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: p.dean@gmx.com (Peter Dean)
Newsgroups: comp.lang.tcl
Subject: Re: Where is the documentation for pkgIndex.tcl files?
Date: Tue, 12 Mar 2024 23:45:25 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 45
Sender: <peter@arch1701.localdomain>
Message-ID: <usqpel$if44$1@dont-email.me>
References: <20240312135747.47f720b7@lud1.home>
Injection-Date: Tue, 12 Mar 2024 23:45:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9598f2c1df894f7d4c99ece55adc7618";
logging-data="605316"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/nvjbFmbLwtr2DrmIpcImh"
User-Agent: tin/2.6.3-20231224 ("Banff") (Linux/6.6.21-1-lts (x86_64))
Cancel-Lock: sha1:N1imaqx/XF8e62ILOzVhW1sITcM=
 by: Peter Dean - Tue, 12 Mar 2024 23:45 UTC

Luc <luc@sep.invalid> wrote:
> I made my very first package today and I hated that part.
>
> See what the wiki says:
>
> https://wiki.tcl-lang.org/page/pkg_mkIndex
>
> pyk 2012-11-02 - dgp stated on the irc channel today that pkg_mkIndex
> is not generally a good idea. It can't possibly solve the problem
> right for any but the most simple packages, and even for those, typing
> the index script yourself is just as easy.
>
> "Just as easy"? I don't think so. What am I supposed to type? Where is
> that documented? I spent a long time looking for that information and
> couldn't find it.
>
> pkg_mkIndex is bad indeed. My package has one, a single one .tcl file,
> and pkg_mkIndex kept producing an empty pkgIndex.tcl file. In one of
> many many many attempts, it generated something I could use and I just
> went with it.
>
> Of course I looked at other packages, but it's hard to make heads and
> tails of the information they contain.
>
>
> "Think of pkg_mkIndex as at best a (poor) tool to help you write
> pkgIndex.tcl files. If you can do a better job by hand (or by template
> substitution during configure) then that is probably better."
> -- dkf ,tcl-core mailing list, 2012-11-07
>
> OK, I wouldn't mind typing it all manually if only I had a clue of
> what is supposed to go in a pkgIndex.tcl file. I swear, I searched
> high and low and couldn't find it. Do you people know where that
> information is found?
>
If you have this book

The Tcl Programming Language
A Comprehensive Guide
Ashok P. Nadkarni

section 13.3.8

If you don't have this book, you should buy it.

Re: Where is the documentation for pkgIndex.tcl files?

<46c36fa0cf9a4fdf7912cda36ca23386@www.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13541&group=comp.lang.tcl#13541

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!.POSTED!not-for-mail
From: r.zaumseil@freenet.de (rene)
Newsgroups: comp.lang.tcl
Subject: Re: Where is the documentation for pkgIndex.tcl files?
Date: Wed, 13 Mar 2024 07:17:47 +0000
Organization: novaBBS
Message-ID: <46c36fa0cf9a4fdf7912cda36ca23386@www.novabbs.com>
References: <20240312135747.47f720b7@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="1814627"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$Z6OMXlKzGU7VX2BMIaTHbOacnadR3CdjPzMaLt/DBkXu7glEPQ98q
X-Rslight-Posting-User: fbed0c2f97ab4966f2db85fe976d69405fa9797c
X-Spam-Checker-Version: SpamAssassin 4.0.0
 by: rene - Wed, 13 Mar 2024 07:17 UTC

https://wiki.tcl-lang.org/page/pkgIndex.tcl

Re: Where is the documentation for pkgIndex.tcl files?

<uss9r8$vgiu$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13542&group=comp.lang.tcl#13542

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: donald.porter@nist.gov (Don Porter)
Newsgroups: comp.lang.tcl
Subject: Re: Where is the documentation for pkgIndex.tcl files?
Date: Wed, 13 Mar 2024 09:31:20 -0400
Organization: ACMD ITL NIST
Lines: 14
Message-ID: <uss9r8$vgiu$1@dont-email.me>
References: <20240312135747.47f720b7@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 13 Mar 2024 13:31:21 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="032a1b6dc57e166128202ca20eb5c8a8";
logging-data="1032798"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Emo3Xd8pnbD15k+ORzae0q2q3dtOb4Cg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:fSO7w2V5hCnAJZjjjdak7UCs5qE=
In-Reply-To: <20240312135747.47f720b7@lud1.home>
Content-Language: en-US
 by: Don Porter - Wed, 13 Mar 2024 13:31 UTC

On 3/12/24 12:57, Luc wrote:
> pkg_mkIndex is bad indeed. My package has one, a single one .tcl file,

For such a simple package structure, installation as a Tcl Module is
probably the best answer.

https://www.tcl-lang.org/man/tcl8.6/TclCmd/tm.htm

--
| Don Porter Applied and Computational Mathematics Division |
| donald.porter@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|

Re: Where is the documentation for pkgIndex.tcl files?

<20240313132840.232d7e1f@lud1.home>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13543&group=comp.lang.tcl#13543

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Where is the documentation for pkgIndex.tcl files?
Date: Wed, 13 Mar 2024 13:28:40 -0300
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <20240313132840.232d7e1f@lud1.home>
References: <20240312135747.47f720b7@lud1.home>
<uss9r8$vgiu$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="01c10b6cd7c5646f69b590cc4119bd17";
logging-data="1098103"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18r+TT56Qxj2YVwKsg9m0CT5Hxu2ANjx38="
Cancel-Lock: sha1:y44TH1qoQS/G9JIA6fLgI51d18A=
 by: Luc - Wed, 13 Mar 2024 16:28 UTC

On Wed, 13 Mar 2024 09:31:20 -0400, Don Porter wrote:

>On 3/12/24 12:57, Luc wrote:
>> pkg_mkIndex is bad indeed. My package has one, a single one .tcl file,
>
>For such a simple package structure, installation as a Tcl Module is
>probably the best answer.
>
>https://www.tcl-lang.org/man/tcl8.6/TclCmd/tm.htm
>
**************************

Interesting. However:

1. Why did someone think that was necessary? What does tm do that
'source' won't do?

2. So one person tells me I have to buy a third-party book, another
points me to a vague and disorganized wiki page with random scattered
tips, you say I should use a module and nobody else has anything to
say. Making packages is de facto undocumented, isn't it?

--
Luc
>>

Re: Where is the documentation for pkgIndex.tcl files?

<tFkIN.110321$Sf59.23889@fx48.iad>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13544&group=comp.lang.tcl#13544

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx48.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Where is the documentation for pkgIndex.tcl files?
Content-Language: en-US
Newsgroups: comp.lang.tcl
References: <20240312135747.47f720b7@lud1.home> <uss9r8$vgiu$1@dont-email.me>
<20240313132840.232d7e1f@lud1.home>
From: Gerald.Lester@gmail.com (Gerald Lester)
In-Reply-To: <20240313132840.232d7e1f@lud1.home>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 36
Message-ID: <tFkIN.110321$Sf59.23889@fx48.iad>
X-Complaints-To: abuse@fastusenet.org
NNTP-Posting-Date: Wed, 13 Mar 2024 16:39:53 UTC
Organization: fastusenet - www.fastusenet.org
Date: Wed, 13 Mar 2024 11:39:53 -0500
X-Received-Bytes: 1980
 by: Gerald Lester - Wed, 13 Mar 2024 16:39 UTC

On 3/13/24 11:28, Luc wrote:
> On Wed, 13 Mar 2024 09:31:20 -0400, Don Porter wrote:
>
>> On 3/12/24 12:57, Luc wrote:
>>> pkg_mkIndex is bad indeed. My package has one, a single one .tcl file,
>>
>> For such a simple package structure, installation as a Tcl Module is
>> probably the best answer.
>>
>> https://www.tcl-lang.org/man/tcl8.6/TclCmd/tm.htm
>>
> **************************
>
>
> Interesting. However:
>
> 1. Why did someone think that was necessary? What does tm do that
> 'source' won't do?
>
> 2. So one person tells me I have to buy a third-party book, another
> points me to a vague and disorganized wiki page with random scattered
> tips, you say I should use a module and nobody else has anything to
> say. Making packages is de facto undocumented, isn't it?

They are pointing you do different resources since seem to be having
problems and did not give any details of what your package looks like.

I've never had any issues with just creating packages. Is your package
provide line correct?

If pkg_mkIndex fails, then generating the package index by hand is
trival, see
https://core.tcl-lang.org/tclws/file?name=pkgIndex.tcl&ci=tip for an
example.

Re: Where is the documentation for pkgIndex.tcl files?

<20240313150125.0a4efa44@lud1.home>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13545&group=comp.lang.tcl#13545

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Where is the documentation for pkgIndex.tcl files?
Date: Wed, 13 Mar 2024 15:01:25 -0300
Organization: A noiseless patient Spider
Lines: 82
Message-ID: <20240313150125.0a4efa44@lud1.home>
References: <20240312135747.47f720b7@lud1.home>
<uss9r8$vgiu$1@dont-email.me>
<20240313132840.232d7e1f@lud1.home>
<tFkIN.110321$Sf59.23889@fx48.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="01c10b6cd7c5646f69b590cc4119bd17";
logging-data="1126413"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19MK0kCTPgAwi9mfMscQN1Xr+tPsZkoqG0="
Cancel-Lock: sha1:1TvLFUwvPBl31/a1G1dzV9EfHik=
 by: Luc - Wed, 13 Mar 2024 18:01 UTC

On Wed, 13 Mar 2024 11:39:53 -0500, Gerald Lester wrote:

>They are pointing you do different resources since seem to be having
>problems and did not give any details of what your package looks like.

Sorry if I may come across as rude, I really don't want that, but pray
tell, if making packages were to be fully documented, what would such
documentation look like? Would it be something like,

"Drop by clt, tell us the details of your package and someone will
tell you what exactly what you need to do to make a package."

I don't think so.

>I've never had any issues with just creating packages.

Good for you. And how did you learn how to do it?

>If pkg_mkIndex fails, then generating the package index by hand is
>trival, see
>https://core.tcl-lang.org/tclws/file?name=pkgIndex.tcl&ci=tip for an
>example.

Interesting document. But it can't answer some questions. To wit,
let's see what the pkgIndex.tcl for BWidget looks like:

package ifneeded BWidget 1.9.16 "\
package require Tk 8.1.1;\
[list tclPkgSetup $dir BWidget 1.9.16 {
{arrow.tcl source {ArrowButton ::ArrowButton::create ::ArrowButton::use}}
{labelframe.tcl source {LabelFrame ::LabelFrame::create ::LabelFrame::use}}
{labelentry.tcl source {LabelEntry ::LabelEntry::create ::LabelEntry::use}}

1. Oh, I can require a certain version of Tk here? Should I? Where?
What is the exact correct position for that? Where is that detail
specified?

2. The manual says,

"source - Evaluate a file or resource as a Tcl script
SYNOPSIS
source fileName
source -encoding encodingName fileName"

I'm not really sure of what a "resource" means here, but the synopsis
leads me to believe that source can only 'source' files.

But the BWidget pkgIndex.tcl is 'sourcing' something else there. What
is it doing? Is it sourcing procs? Is it sourcing classes? Is it
sourcing namespaces? Is that possible? Who told the author of BWidget
that sourcing whatever his pkgIndex.tcl is sourcing was within the
realm of possibility? Where do you people learn these things?

OK, I can inspect arrow.tcl for example and find out that ArrowButton
is a namespace. But I never knew we could 'source' a namespace. And
how could I? The word 'source' is not even mentioned once in the
'namespace' manual page.

Now, what is the meaning of this line?

ArrowButton ::ArrowButton::create ::ArrowButton::use

A bare word (it looks like it to me) followed by two procs with fully
qualified names. It is particularly confusing because the arrow.tcl
file (clearly specified at the beginning of the line) does contain the
::ArrowButton::create proc, but makes no mention of ::ArrowButton::use.
In fact, grep tells me that no file in BWidget mentions this
mysterious ::ArrowButton::use proc. So what is ::ArrowButton::use?

I don't want to discuss the internals of BWidget. It's just a random
example. The question is, why is that included in the pkgIndex.tcl
file? Why does Tcl/Tk have no problem with a proc that doesn't exist?
How do I know what is possible or permitted and what is not?

Do you see now where I am coming from?

--
Luc
>>

Re: Where is the documentation for pkgIndex.tcl files?

<UkmIN.436274$Ama9.423556@fx12.iad>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13546&group=comp.lang.tcl#13546

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Where is the documentation for pkgIndex.tcl files?
Content-Language: en-US
Newsgroups: comp.lang.tcl
References: <20240312135747.47f720b7@lud1.home> <uss9r8$vgiu$1@dont-email.me>
<20240313132840.232d7e1f@lud1.home> <tFkIN.110321$Sf59.23889@fx48.iad>
<20240313150125.0a4efa44@lud1.home>
From: Gerald.Lester@gmail.com (Gerald Lester)
In-Reply-To: <20240313150125.0a4efa44@lud1.home>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 62
Message-ID: <UkmIN.436274$Ama9.423556@fx12.iad>
X-Complaints-To: abuse@fastusenet.org
NNTP-Posting-Date: Wed, 13 Mar 2024 18:34:28 UTC
Organization: fastusenet - www.fastusenet.org
Date: Wed, 13 Mar 2024 13:34:28 -0500
X-Received-Bytes: 3156
 by: Gerald Lester - Wed, 13 Mar 2024 18:34 UTC

On 3/13/24 13:01, Luc wrote:
> On Wed, 13 Mar 2024 11:39:53 -0500, Gerald Lester wrote:
>
>> They are pointing you do different resources since seem to be having
>> problems and did not give any details of what your package looks like.
>
> Sorry if I may come across as rude, I really don't want that, but pray
> tell, if making packages were to be fully documented, what would such
> documentation look like? Would it be something like,
>
> "Drop by clt, tell us the details of your package and someone will
> tell you what exactly what you need to do to make a package."
>
> I don't think so.
>
>
>> I've never had any issues with just creating packages.
>
> Good for you. And how did you learn how to do it?

Honestly don't remember, it was right after the package command was
introduced, something like about 30 years ago or more (I think that was
Tcl 8.0 -- or may have even been in 7.6 -- maybe earlier, but I don't
think so).

>
>> If pkg_mkIndex fails, then generating the package index by hand is
>> trival, see
>> https://core.tcl-lang.org/tclws/file?name=pkgIndex.tcl&ci=tip for an
>> example.
>
> Interesting document.

It is NOT A DOCUMENT! As I wrote it is an EXAMPLE. It is a simple
example that can be used for a good number of use cases.

> But it can't answer some questions. To wit,...
<deleted a bunch of verbiage about BWidgets>

> Why does Tcl/Tk have no problem with a proc that doesn't exist?

You need to step back and understand about Tcl's auto loading via the
standard unknown proc for an answer to that.

> How do I know what is possible or permitted and what is not?

Almost anything is possible and just about anything is permitted. That
does not mean you should do it.

I have seen package if needed that read from database and others that
pulled over a socket. Does not mean you should do that until you really
understand what is going on by looking at the code that implements the
package system and the auto load systems.

In Tcl there are many times multiple ways to do things that were added
over the years with the newwer ones being improvements and the older
ones kept so as not to break existing code.

> Do you see now where I am coming from?

Actually no. Your post goes all over the place.

Re: Where is the documentation for pkgIndex.tcl files?

<20240313160244.63f40431@lud1.home>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13547&group=comp.lang.tcl#13547

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Where is the documentation for pkgIndex.tcl files?
Date: Wed, 13 Mar 2024 16:02:44 -0300
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <20240313160244.63f40431@lud1.home>
References: <20240312135747.47f720b7@lud1.home>
<uss9r8$vgiu$1@dont-email.me>
<20240313132840.232d7e1f@lud1.home>
<tFkIN.110321$Sf59.23889@fx48.iad>
<20240313150125.0a4efa44@lud1.home>
<UkmIN.436274$Ama9.423556@fx12.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="01c10b6cd7c5646f69b590cc4119bd17";
logging-data="1162239"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/I6xw9y877//tw+5FOLqNFWeanKNh9Ovk="
Cancel-Lock: sha1:wVt+vIXCQ87/O3rqM03pqEm/nx0=
 by: Luc - Wed, 13 Mar 2024 19:02 UTC

On Wed, 13 Mar 2024 13:34:28 -0500, Gerald Lester wrote:

>Almost anything is possible and just about anything is permitted. That
>does not mean you should do it.

Almost? What is not possible?

>I have seen package if needed that read from database and others that
>pulled over a socket.

But have you seen any of that documented?

>Does not mean you should do that until you really
>understand what is going on by looking at the code that implements the
>package system and the auto load systems.

"Read the code and figure it all out by yourself."

Confirmed. It's undocumented.

>Actually no. Your post goes all over the place.

No. I make a very clear point that the procedure is undocumented and
everybody seems to learn it only through some kind of grapevine.

- What does Tcl expect from a pkgIndex.tcl file?
- What is the absolute minimum information it must contain?
- What is the correct format of the information?
- What else is allowed?
- In what format?
- What are the effects of such options?

But ok, I consider it answered. Thank you.

--
Luc
>>

Re: Where is the documentation for pkgIndex.tcl files?

<slrnuv43ci.7bq.avl@logic.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13548&group=comp.lang.tcl#13548

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: Re: Where is the documentation for pkgIndex.tcl files?
Date: Wed, 13 Mar 2024 20:33:22 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 127
Message-ID: <slrnuv43ci.7bq.avl@logic.at>
References: <20240312135747.47f720b7@lud1.home>
<uss9r8$vgiu$1@dont-email.me> <20240313132840.232d7e1f@lud1.home>
<tFkIN.110321$Sf59.23889@fx48.iad> <20240313150125.0a4efa44@lud1.home>
<UkmIN.436274$Ama9.423556@fx12.iad> <20240313160244.63f40431@lud1.home>
Reply-To: avl@logic.at
Injection-Date: Wed, 13 Mar 2024 20:33:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="38f39cf939d4c38077bc046c3ed8476f";
logging-data="1205958"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QDue+GiubM19dlavcFUuS"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:Tnm+ZSXTHFDGwgjni5qOCJA1Ho4=
 by: Andreas Leitgeb - Wed, 13 Mar 2024 20:33 UTC

Luc <luc@sep.invalid> wrote:
> On Wed, 13 Mar 2024 13:34:28 -0500, Gerald Lester wrote:
>>Almost anything is possible and just about anything is permitted. That
>>does not mean you should do it.
> Almost? What is not possible?

(As an ice breaker for starting - below it I'm more serious)
In the past, "making coffee" was a standard answer to that, but in
some EuroTcl conferences of last few years, we have learnt better,
so, I'll say "making hot chocolate", until John's devices fill that
gap ;-)

>>I have seen package if needed that read from database and others that
>>pulled over a socket.
> But have you seen any of that documented?

The relevant documentation is the doc for "package" and within
that the paragraph about "ifneeded".
from there, we will analyze the building blocks one by one...

package ifneeded fubar 1.42.54 {puts hello}

Essentially, with that command you tell the tcl interp that:
If ever you need version 1.42.54 of package fubar, then
execute this script: {puts hello}

If your script lateron calls this command:
package require fubar
then you'll see the "hello" printed out, and it will detect, that
calling this script didn't really do its job of "providing" the
package:

% package require fubar
hello
attempt to provide package fubar 1.42.54 failed: no version of package fubar provided
%

Now lets have another look at what BWidget does:
package ifneeded BWidget 1.9.16 "\
package require Tk 8.1.1;\
[list tclPkgSetup $dir BWidget 1.9.16 {
{arrow.tcl source {ArrowButton ::ArrowButton::create ::ArrowButton::use}}
{labelframe.tcl source {LabelFrame ::LabelFrame::create ::LabelFrame::use}}
{labelentry.tcl source {LabelEntry ::LabelEntry::create ::LabelEntry::use}}

Upon eventually requiring BWidget later, the following script would
be executed:

package require Tk 8.1.1
tclPkgSetup $dir BWidget 1.9.16 { ... }

where $dir is actually replaced already within BWidget's pkgIndex.tcl,
so commands are really something like:

package require Tk 8.1.1
tclPkgSetup /x/y/z BWidget 1.9.16 { ... }

What is inside the curlies is only relevant to that command "tclPkgSetup"
which expects a nested list structure describing files, types, and a
list of commands that will be made available by treating the file
according to its type.

tclPkgSetup is really a helper procedure, whose definition can be
examined using: info body tclPkgSetup
I didn't find any man-page for that helper command. Googling
for it might find something.

Eventually, the script have called something like
package provide BWidget 1.9.16
(which, btw., the "tclPkgSetup" does inside it, among other stuff)

So we could create our dummy package correctly like this:

package ifneeded fubar 1.42.54 { package provide fubar 1.42.54 }

and a later

package require fubar

will return "1.42.54" as the version successfully loaded.

Anything else that your package will later need to get loaded
ought to be prepared within that script.

> - What does Tcl expect from a pkgIndex.tcl file?

That it sets up the "ifneeded" script, that will be executed once
the package is actually required by a specific application script.

> - What is the absolute minimum information it must contain?

It could be empty, but then it would be useless.
It could contain a "puts hello", but that would be printed regardless
of whether the package is actually needed for a tcl application, so
would be very bad practise.
Ideally it would only contain "package ifneeded" invocations for each
package it is meant to make available.

package ifneeded moinmoin 0.0.1 {
puts "Good morning, Tcl!"
package provide moinmoin 0.0.1
}

> - What is the correct format of the information?

A tcl script that does the "right thing"(tm) for the package at hand.

> - What else is allowed?

As little as possible to get the package advertising done.

Anything else would make tcl startup slower for all scripts,
even those not needing that package.

> - In what format?

in tcl script format. (That means, it could contain nested
blocks of utter garbage, as long as that garbage is corrctly
understood by the command to which the garbage is really passed.)

> - What are the effects of such options?

That depends on the command, to which they are actually passed.

Re: Where is the documentation for pkgIndex.tcl files?

<20240313212000.77f37f56@lud1.home>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13549&group=comp.lang.tcl#13549

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Where is the documentation for pkgIndex.tcl files?
Date: Wed, 13 Mar 2024 21:20:00 -0300
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <20240313212000.77f37f56@lud1.home>
References: <20240312135747.47f720b7@lud1.home>
<uss9r8$vgiu$1@dont-email.me>
<20240313132840.232d7e1f@lud1.home>
<tFkIN.110321$Sf59.23889@fx48.iad>
<20240313150125.0a4efa44@lud1.home>
<UkmIN.436274$Ama9.423556@fx12.iad>
<20240313160244.63f40431@lud1.home>
<slrnuv43ci.7bq.avl@logic.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="35f0f3d50ae8d957fd27287bad6bdde1";
logging-data="1300517"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19TfiqNJn+52AwBYZkCKO1HNp71IY8qhQo="
Cancel-Lock: sha1:3/LI8JnOlsd9nb9v35vzXSCJcUM=
 by: Luc - Thu, 14 Mar 2024 00:20 UTC

On Wed, 13 Mar 2024 20:33:22 -0000 (UTC), Andreas Leitgeb wrote:

>(As an ice breaker for starting - below it I'm more serious)
**************************

That is informative. Thank you.

--
Luc
>>

Re: Where is the documentation for pkgIndex.tcl files?

<ustm7t$18qgt$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13550&group=comp.lang.tcl#13550

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et99@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: Where is the documentation for pkgIndex.tcl files?
Date: Wed, 13 Mar 2024 19:09:00 -0700
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <ustm7t$18qgt$1@dont-email.me>
References: <20240312135747.47f720b7@lud1.home> <uss9r8$vgiu$1@dont-email.me>
<20240313132840.232d7e1f@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 14 Mar 2024 02:09:01 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="71dfd47518a9a93d1f2fa8ee433dda94";
logging-data="1337885"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+l1aJRmPNBy1oEFmA8OB3/"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:AiySGV84plOSE0bRJg1RvnckLbM=
Content-Language: en-US
In-Reply-To: <20240313132840.232d7e1f@lud1.home>
 by: et99 - Thu, 14 Mar 2024 02:09 UTC

On 3/13/2024 9:28 AM, Luc wrote:
> On Wed, 13 Mar 2024 09:31:20 -0400, Don Porter wrote:
>
>> On 3/12/24 12:57, Luc wrote:
>>> pkg_mkIndex is bad indeed. My package has one, a single one .tcl file,
>>
>> For such a simple package structure, installation as a Tcl Module is
>> probably the best answer.
>>
>> https://www.tcl-lang.org/man/tcl8.6/TclCmd/tm.htm
>>
> **************************
>
>
> Interesting. However:
>
> 1. Why did someone think that was necessary? What does tm do that
> 'source' won't do?
>
> 2. So one person tells me I have to buy a third-party book, another
> points me to a vague and disorganized wiki page with random scattered
> tips, you say I should use a module and nobody else has anything to
> say. Making packages is de facto undocumented, isn't it?
>
>

Many years ago I heard about a new language called C. I read a few things about it but thought it was a very strange language, with a lot of funny looking operators.

Then I discovered the C white book by Brian Kernighan and Dennis Ritchie. I got my employer to pay for it, but also bought one for myself, in case I left the job for better pastures.

Tcl is an open source, community supported language. The documentation is created by people just like you who don't get paid anything for it. You can volunteer to help if you think you can do better.

But if you want the Kernighan experience, you need to buy the "Tcl programming language" book by Ashok. If you can't afford the paper-bound book, then buy the pdf. It costs about the same as a gallon of orange juice and a loaf of bread, but took the author a lot of time putting it together. Ashok also has a great resource for looking up most anything from the official documentation at his website, which he provides for free.

You would save yourself a lot of effort if you would save up the $18 and buy the pdf version of his book.

That is where I learned about tcl OO, tcl modules, and threads, just to name a few items.

The advantage of the module system over just "source" is that you can incorporate the package command's versioning system. It was written IMO to simplify the package system whose command had become rather complicated.

I create modules. The http command is a module. There are many others that are available by package require.

It's your choice, get frustrated, or get the book.

Re: Where is the documentation for pkgIndex.tcl files?

<20240314101514.4450cbf3@lud1.home>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13553&group=comp.lang.tcl#13553

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Where is the documentation for pkgIndex.tcl files?
Date: Thu, 14 Mar 2024 10:15:14 -0300
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <20240314101514.4450cbf3@lud1.home>
References: <20240312135747.47f720b7@lud1.home>
<uss9r8$vgiu$1@dont-email.me>
<20240313132840.232d7e1f@lud1.home>
<ustm7t$18qgt$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="f150cf11df883a9f4307f0d3029c237b";
logging-data="1711620"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18uOhsSbkAgXZE98dCHJGa9/h/tU5dCOgo="
Cancel-Lock: sha1:87877T9WxMXvhvR/vsu+Ys1APKA=
 by: Luc - Thu, 14 Mar 2024 13:15 UTC

On Wed, 13 Mar 2024 19:09:00 -0700, et99 wrote:

>But if you want the Kernighan experience, you need to buy the "Tcl
>programming language" book by Ashok. If you can't afford the paper-bound
>book, then buy the pdf. It costs about the same as a gallon of orange
>juice and a loaf of bread, but took the author a lot of time putting it
>together. Ashok also has a great resource for looking up most anything
>from the official documentation at his website, which he provides for free.

As someone who actually has had to skip meals very frequently lately
in a constant struggle not to go homeless, I absolutely prefer the
gallon of orange juice and loaf of bread.

And I am sick, really sick of reading advertisements for that book.

Forget this topic. I don't care anymore.

--
Luc
>>

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor