On Thu, Nov 18, 2010 at 7:08 PM, Wolfgang Schuster
<[email protected]> 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 : [email protected] / 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
___________________________________________________________________________________