Re: Installing a module

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Installing a module
De : rich (at) *nospam* example.invalid (Rich)
Groupes : comp.lang.tcl
Date : 23. Jun 2025, 04:58:16
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <103ajco$116j8$1@dont-email.me>
References : 1
User-Agent : tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
saito <saitology9@gmail.com> wrote:
Modules seem to refuse this simplicity.  A module is supposed be a
single file.  But I am not sure this is true in practice.

This is in reference to the Tcl interpreter view, not the "human
distributor viewpoint".

So there is a module I want to use. It comes as a zipped file. Unzipped,
it has a readme, a copyright file, a subfolder, and a .tm file.

The only "module" file present there (as far as Tcl is concerned) is
the .tm file.  That is the "module", and is all Tcl will look for when
you try to package require the module.  The other files are essentially
side-cars for human use.  The subfolder may or may not contain files
that the code inside the .tm uses, so it may, or may not, be needed.

I could create a folder dedicated to modules, adjust the tm paths, and
put all those in there. At first, this seems like it will work.

If all your .tm files do not try to consume other files (code in a
mudule can do anything Tcl can do) you could have a single directory
containing 100 .tm files, and be able to package require any one to
all, by pointing the module path at that single directory.  And you
could continue to add more by adding more .tm files there.

However, what happens when I want to use a new module? Presumable it too
will have its own readme, copyright, etc. So I can't just put it in that
folder as it will overwrite the previous module. So I need to create a
new folder, revise the tm paths, etc.

Only if you wish to keep copies of all the side-car files present for
human consumption.  If you just want a collection of modules, you don't
need the side-cars (for package require purposes).  Of course, if in X
years you wonder where module blah.tm came from, not having the
side-car files around might make the task of tracking it down a bit
more difficult.


Date Sujet#  Auteur
23 Jun 25 * Re: Installing a module4Rich
23 Jun 25 +* Re: Installing a module2Harald Oehlmann
23 Jun 25 i`- Re: Installing a module1saito
23 Jun 25 `- Re: Installing a module1saito

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal