From: luigi scarso <luigi.scarso@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Module Namespaces
Date: Thu, 18 Nov 2010 19:33:27 +0100 [thread overview]
Message-ID: <AANLkTimCNfAyAyM5n-pByz2Et2LdFcB2j7wSv0CgDVNn@mail.gmail.com> (raw)
In-Reply-To: <5C7A72C2-8353-4957-96B4-B37673516F14@gmail.com>
On Thu, Nov 18, 2010 at 7:08 PM, Wolfgang Schuster
<schuster.wolfgang@googlemail.com> wrote:
>
> Am 18.11.2010 um 10:13 schrieb luigi scarso:
>
>> Nice
>> http://wiki.contextgarden.net/Module_Namespaces
>>
>> Can I register lscarso[a-zA-Z]* ?
>
> Why? The obvious method is to use the same name for the namespace as you use for your module name or the command names, e.g. the fancybreak module has the commands \definefancybreak, \setupfancybreak and the namespace „fancybreak“ and Adityas visualcounter module can use the namespace „visualcounter“ (there is no need to use capitals).
I just want to register my namespace(s) to be sure to avoid conflicts
not only for modules but also for lua code
Think for example to something like
document.lscarso = document.lscarso or {}
function document.lscarso.lua_pixGetPixel(pixs,x,y)
local scratch = 0
local res = ''
scratch = leptonica.uti_getref_l_uint32()
if (leptonica.pixGetPixel(pixs,x,y,scratch) == 0) then
res = leptonica.uti_valref_l_uint32(scratch)
else
print("! Error on ",x,y)
res = ''
end
return res
end
with a registered namespace (or, better, a suffix) I will be sure to
avoid conflicts forever
--
luigi
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2010-11-18 18:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-18 9:13 luigi scarso
2010-11-18 9:26 ` Philipp Gesang
2010-11-18 18:08 ` Wolfgang Schuster
2010-11-18 18:33 ` luigi scarso [this message]
2010-11-29 18:17 ` Wolfgang Schuster
2010-11-29 18:52 ` Philipp Gesang
2010-11-29 19:10 ` luigi scarso
2010-12-06 16:50 ` Hans Hagen
2010-12-08 13:17 ` Philipp Gesang
2010-12-06 16:48 ` Hans Hagen
2010-11-29 18:19 ` Wolfgang Schuster
2010-11-18 21:03 ` Aditya Mahajan
2010-11-18 21:19 ` luigi scarso
2010-11-18 21:45 ` Hans Hagen
2010-11-18 21:48 ` Aditya Mahajan
2010-11-18 21:52 ` Hans Hagen
2010-11-18 21:59 ` luigi scarso
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=AANLkTimCNfAyAyM5n-pByz2Et2LdFcB2j7wSv0CgDVNn@mail.gmail.com \
--to=luigi.scarso@gmail.com \
--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).