On 10/28/2018 5:06 PM, Joseph Wright wrote:
Hello all,

Looking at management of global Lua tables (for the obvious cases ...), I notice that all of the core Mk IV files use the construct

     if not modules then modules = { } end
     modules["<file-name"] = { -- meta-data here

From a ConTeXt point-of-view, is it acceptable for third-parties to use this construct, or is it 'ConTeXt maintainers only'? I'm wondering for code used generically: it would be good to use the same approach, but I don't want to tread on any reserved namespaces.
Hard to say ... the only generic code is the fontloader and the only check done there is the toplevel 'context' table, so there is not much change on a clash I guess. We can hardly claim a namespace, but now at least it's possible to see if something is meant for context (and originates on context, fwiw).

Anyway, I don't expect much generic code to show up. One problem I see is that currently, as context uses that namespace, there are no duplicates. So, it being used more general, probably means that I need to add a mechanism that will refuse to (over)load code, but even then i cannot oversee implications ... For latex you can consider 'latexmodules' ... up to you. It's too late now to change it to contextmodules.

Hans



-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to