Re: What would you like to see in XML::LibXML ?

Aristotle Pagaltzis <[email protected]> Tue, 31 Jan 2012 08:44:55 +0100
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
Hi Shlomi,

* Shlomi Fish <[email protected]> [2012-01-29 21:15]:
> * Aaron Crane <[email protected]> [2012-01-29 15:55]:
> > I believe the tricky bit is ensuring that the annotations always
> > have their reference counts updated at precisely the right time.
>
> Yes, it would be very tricky. One option to overcome this may be to
> make these annotations be “tokens” which are arbitrary perl strings
> or numbers, but not arbitrary perl scalars. The XML-LibXML programmer
> will be able to map or unpack these tokens into something more
> complex, but it would be their responsibility to allocate unique
> tokens and to free their resources later.

that manages to just barely allow Aaron’s use case at all, but it does
not make it possible to do it solidly, much less do it with a semblance
of convenience. It leaves what is essentially LibXML’s responsibility
as an exercise to the client code, which does not have exact knowledge
of what is going on in the DOM data structure, and is thus left to try
doing an approximate job of managing its own associated resources.

Aaron may feel differently about this, but to be honest, if this is your
final offer (so to say), then I would rather prefer that the feature not
be added at all than tie up the _private slot and stunt the possibility
of a more a elegant interface in the future.

If it is *impossible* to do correctly, then that is another matter. If
it merely is very tricky, though, then it is the job of an API to hide
this exact kind of complexity behind a veil of magic. LibXML does quite
a good job of this for libxml2 in other areas.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs