On 11/5/2014 10:28 AM, Mikael P. Sundqvist wrote:
On Wed, Nov 5, 2014 at 8:42 AM, Akira Kakuto <kak...@fuk.kindai.ac.jp> wrote:
Dear Mikael,

An example from PGFPlots Gallery.
Please try if it works. Here on windows, it seems to work.
Attached files are tt.log.txt and tt.pdf.

Best,
Akira


Dear Akira,

since loading the package generates the error, this example does not
work either. I guess (hope) that the clash in version or what it is
will be resolved soon.

the pgf file structure is just wrong, if you run this you can see where is searched:

\starttext
    \startluacode
        package.helpers.trace = true
        io.savedata("foo.bar.lua",[[print("hello")]])
        require ("foo.bar")
    \stopluacode
\stoptext

so, if you want to

  require("foo.bar.whatever"

it should be e.g.:

 tex/generic/foo/bar/whatever.lua

when kpse is plugged into the package loader it might find foo.bar.whatever.lua but context is not going to support that lookup; in that case

dofile(resolvers.findfile("foo.bar.whatever.lua"))

has to be used.

Also keep in mind that dot separated filenames can conflict with module initialization functions (e.g. when you have foo.core.lua it would load foo and initialize using the core function in it). The require functionality is already messy enough and adding all kind of catches to it would make it worse.

(Context already has an extended and quite extensive loader, including versions external libraries and so but that's another story.)

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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