On 22-8-2012 14:55, Rogers, Michael K wrote:
In a recent thread, Hans used the document namespace, where I (naively)
expected userdata:
On Aug 22, 2012, at 6:32 AM, Hans Hagen wrote:
\ctxlua{document.myluadimension = "200pt"}
Is there a reason not to use userdata.myluadimension? Or is document.myluadimension safe,
because myluadimension is almost certainly not an entry used by ConTeXt? Is using
document.myluadimension better "style" here, in some sense? Somewhere I had
gotten the idea that if a ConTeXt user wanted to store something in Lua, they ought to
store it in the userdata namespace.
Sure. Actually the document namespace has some functions so there is
more danger in a clash there, so userdata is better.
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
___________________________________________________________________________________