On 4/23/2014 3:07 PM, Stéphane Goujet wrote:
On Wed, 23 Apr 2014, Hans Hagen wrote:
On 4/22/2014 8:10 PM, Stéphane Goujet wrote:
Please have a look at my example (it is a bit long because it shows various possibilities) and its result. When I have not yet done a \defineattribute[myattr], node.has_attribute returns 0 when I thought it should return nil. When I do \defineattribute[...], every attribute seems to get the same number (1024), but now node.has_attribute returns nil ...
change this is syst-ini.mkiv:
\normalprotected\def\newattribute{\syst_basics_allocate\c_syst_last_allocated_attribute\attribute\attributedef\c_syst_max_allocated_register}
Thank you, it seems to work much better !
There is still the problem that "node.has_attribute" does not return "nil" when I expect it should, but that is luatex problem (a check that a parameter is really an integer should be performed before calling lua_tointeger), so I will change mailing-list in order to report it.
that interface is unlikely to change (e.g. because of performance reasons) ... you'd better check at your end btw, you can try: mynode[123] which is more efficient ----------------------------------------------------------------- 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 -----------------------------------------------------------------