From: Ulrike Fischer <news3@nililand.de>
To: ntg-context@ntg.nl
Subject: Re: search path for require(...)
Date: Thu, 24 Mar 2011 12:41:42 +0100 [thread overview]
Message-ID: <1utkce0a0kkh9$.dlg@nililand.de> (raw)
In-Reply-To: <20110324105047.GE3626@orcus>
Am Thu, 24 Mar 2011 11:50:47 +0100 schrieb Philipp Gesang:
>>> (You’re going to have to declare the table “chessfss” globally
>>> for this to work.)
>>
>> The chessfss.lua has a "return Table" at the end which declares the
>> table chessfss.
>>
>> To quote from http://lua-users.org/wiki/LuaModuleFunctionCritiqued:
>>
>> "The problems above can be avoided by not using the module function
>> but instead defining modules in the following simple way: [*1][*2]
>
> Of course, that’s the Lua way. I can’t guess what you’re up to
> but if it’s going to eventually become a module, the “chessfss”
> table should not pollute the global namespace. There are
> canonical locations (check luat-ini.lua) where the functions and
> data should go:
>
> http://www.ntg.nl/pipermail/ntg-context/2010/054982.html
>
> So you might be better off dropping “require” altogether and just
> conclude your module with a line like:
>
> thirddata = thirddata or { }
> thirddata.chessfss = chessfss
>
> instead of returning a table, then loading it with “loadluafile”.
I'm not writing a module but virtual fonts, and they can be used
with context and latex. So whatever I will be doing should not be
context specific. But I will test if I can keep the chessfss-table
local, and if not put it in thirddata if it exists.
--
Ulrike Fischer
___________________________________________________________________________________
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
___________________________________________________________________________________
prev parent reply other threads:[~2011-03-24 11:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-24 9:50 Ulrike Fischer
2011-03-24 10:14 ` Philipp Gesang
2011-03-24 10:34 ` Ulrike Fischer
2011-03-24 10:50 ` Philipp Gesang
2011-03-24 11:41 ` Ulrike Fischer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='1utkce0a0kkh9$.dlg@nililand.de' \
--to=news3@nililand.de \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).