You are viewing a plain text version of this content. The canonical link for it is here.
Posted to p-dev@xerces.apache.org by "Jason E. Stewart" <ja...@openinformatics.com> on 2001/03/14 03:15:37 UTC

devo changes

Hey All,

I just checked in some new code for postModule.pl in the SWIG-1_3
branch. Here is the summary from the ChangeLog:
* any function that returns a DOM_NodeList will return a perl list if
  called in list context 
* any function that returns a DOM_NamedNodeMap will return a perl hash
  if called in list context 

I find these pretty useful, I hope others will, too.

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Re: devo changes

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Fredrick Paul Eisele" <ph...@netarx.com> writes:

> On Tuesday 13 March 2001 21:15, you wrote:

> > I just checked in some new code for postModule.pl in the SWIG-1_3
> > branch. Here is the summary from the ChangeLog:
> > * any function that returns a DOM_NodeList will return a perl list if
> >   called in list context
> > * any function that returns a DOM_NamedNodeMap will return a perl hash
> >   if called in list context
> >
> > I find these pretty useful, I hope others will, too.

> Yes, those sound useful; provided, if called in scalar context they
> still return a DOM_NodeList or DOM_NamedNodeMap.

Yes, indeed they do. Best of both worlds.

> By the way, thanks for the report on the improved Perl debugger behavior.

Welcome, I was pleasantly surprised.

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Re: devo changes

Posted by Fredrick Paul Eisele <ph...@netarx.com>.
On Tuesday 13 March 2001 21:15, you wrote:
> Hey All,
>
> I just checked in some new code for postModule.pl in the SWIG-1_3
> branch. Here is the summary from the ChangeLog:
> * any function that returns a DOM_NodeList will return a perl list if
>   called in list context
> * any function that returns a DOM_NamedNodeMap will return a perl hash
>   if called in list context
>
> I find these pretty useful, I hope others will, too.
Yes, those sound useful; provided, if called in scalar context they
still return a DOM_NodeList or DOM_NamedNodeMap.
By the way, thanks for the report on the improved Perl debugger behavior.

-- 
Fredrick Paul Eisele
30910 Telegraph Rd.
Bingham Farms, MI
1.248.647.9800

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Re: devo changes

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Harmon S. Nine" <hn...@netarx.com> writes:

> What would be ultra -cool to do in this case is to instead return
> references to arrays/hashes that are TIED to the actual objects.
> Then, for instance, on a hash made from a DOM_NamedNodeMap, the
> assignment operation on a hash element could be mapped to
> setNamedItem, delete on a hash element could be mapped to
> deleteNamedItem, etc.

So, SWIG has already tied all it's objects as hashes for us. I agree
that this would be very useful, but probably a lot of work:
1) all the rest of the tied class functions (e.g. EXISTS, NEXTKEY,
   etc) would have to be done for ARRAY (NodeList) and HASH
   (NamedNodeMap). 
2) NodeList is already tied as a HASH, stopping SWIG from doing that,
   would mean a lot of trouble (Could one use a pseudo-hash??).

So my feeling is that the gain in functionality is small versus the
time required to get it to work. That said. If you're willing, then by
all means, jump to it ;-)

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Re: devo changes

Posted by "Harmon S. Nine" <hn...@netarx.com>.
Jason E. Stewart wrote:

> Hey All,
> 
> I just checked in some new code for postModule.pl in the SWIG-1_3
> branch. Here is the summary from the ChangeLog:
> * any function that returns a DOM_NodeList will return a perl list if
>   called in list context 
> * any function that returns a DOM_NamedNodeMap will return a perl hash
>   if called in list context 
> 
> I find these pretty useful, I hope others will, too.

As long as scalar context returns the actual objects, this is fine.  
However,
one problem in doing this is that any API methods on the object that 
don't have perl
counterparts are lost.  As a result, for instance, the hash made from a
DOM_NamedNodeMap  does not allow use of the setNamedItem or removeNamedItem
methods in the DOM_NamedNodeMap API.

What would be ultra -cool to do in this case is to instead return 
references to
arrays/hashes that are TIED to the actual objects.  Then, for instance, on a
hash made from a DOM_NamedNodeMap, the assignment operation on a hash 
element
could be mapped to setNamedItem, delete on a hash element could be mapped to
deleteNamedItem, etc.

I'll research how this could be done. :-)

-- Harmon


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org