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?
pkg_mkIndex is bad indeed. My package has one, a single one .tcl file,
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
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.
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.
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.
Actually no. Your post goes all over the place.
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?
- 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?
(As an ice breaker for starting - below it I'm more serious) **************************
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?
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.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 406 |
Nodes: | 16 (2 / 14) |
Uptime: | 106:47:53 |
Calls: | 8,526 |
Calls today: | 5 |
Files: | 13,209 |
Messages: | 5,920,277 |