Hello!

> Why don’t you use the \usepath command.

Because it is too magical. We DO need magic to locate system
libraries. But we DO NOT need magic to locate our own project files.
For this reason, the C language has
#include <system_lib.h>
and
#include "local_lib.h"

I don't want the file to be searched in a pile of directories. I know
exactly where the component is: it is, here:
open_mapping_theorem/notes.tex
but this location is relative to the product directory:
products/functional_analysis.
Which is relative to the project directory.

The recommended project structure is: project/products/components.
Each product is aware of its own components. And each component is
aware of its "sub-components". But the components or the subcomponents
do not need to know anything about where exactly they live inside the
project. The only magic the products need, for example, is that
project wide environments are loaded automatically.

Suppose I have a project with a 100 products with 20 components each.
With all magic provided by the usepath, my components will have to be
too much aware of the remaining other 100 projects. Files will have to
have unique names, even if they are in different products.

I don't really know the internals of it, but the
\ctxloadluafile{module} looks like an example. In my system there is
the file:
/usr/share/texmf/tex/context/base/file-job.mkiv
inside it, there is a \ctxloadluafile to load "file-job.lua". It seems
to me that ctxloadluafile looks for the lua file in the same directory
of the mkiv file that includes it. If this is not the way
ctxloadluafile is implemented, I would suggest that it be. If you load
the module using
context --usemodule=my_lib/my_module.mkiv my_product.tex, then, the
best bet is to load the my_module.lua from the same directory where
my_module.mkiv lives in. I am not sure, but I guess this is the
behaviour that makes most sense.

Another example is the PHP language. The behaviour of the "required()"
command is to look on the current working directory. And for that
reason, the PHP codes are full of:
require(dirname(__FILE__)."/path/relative/file_to_include.php");

I believe thing should be:
1. Predictable.
2. Local.

For that reason, I don't want to use "\usepath".

But even if this was not the case, it makes no sense to me that I
cannot call "\component \macroname". Isn't it an expected behaviour?


André Caldas.
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to