You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@lyra.org> on 2003/02/13 01:52:14 UTC

Re: svn commit: rev 4848 - trunk/subversion/bindings/swig

On Tue, Feb 11, 2003 at 05:57:46PM -0600, dlr@tigris.org wrote:
>...
> +++ trunk/subversion/bindings/swig/apr.i	Tue Feb 11 17:57:29 2003
>...
>  /* -----------------------------------------------------------------------
>    handle apr_file_t *
>  */
> @@ -153,7 +162,7 @@
>     apr_file_t ** is always an OUT param
>  */
>  
> -%typemap(in,numinputs=0) apr_file_t ** (apr_file_t *temp)
> +%typemap(python, in, numinputs=0) apr_file_t ** (apr_file_t *temp)
>      "$1 = &temp;";

I see nothing Python specific there. Why was this change made?

As much as possible, we should NOT insert language-specific tags in this
SWIG stuff. That just introduces duplication and, thus, dual maintenance
problems.

Heck, I'm hoping that we might find some patterns in the Java vs Python SWIG
typemaps. If we *do*, then we could create some SWIG macros to deal with
those differences, and then unify some typemaps. Just gotta wait and see
where we end up...

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 4848 - trunk/subversion/bindings/swig

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Jesper Steen Møller <je...@selskabet.org> writes:

> Daniel Rall wrote:
> 
> >Greg Stein <gs...@lyra.org> writes:
> >
> 
> >>On Tue, Feb 11, 2003 at 05:57:46PM -0600, dlr@tigris.org wrote:
> >>
> 
> >>>...
> >>>+++ trunk/subversion/bindings/swig/apr.i	Tue Feb 11 17:57:29 2003
> >>>...
> >>> /* -----------------------------------------------------------------------
> >>>   handle apr_file_t *
> >>> */
> >>>@@ -153,7 +162,7 @@
> >>>    apr_file_t ** is always an OUT param
> >>> */
> >>> -%typemap(in,numinputs=0) apr_file_t ** (apr_file_t *temp)
> 
> >>>+%typemap(python, in, numinputs=0) apr_file_t ** (apr_file_t *temp)
> >>>     "$1 = &temp;";
> >>>
> 
> >>I see nothing Python specific there. Why was this change made?
> >>
> 
> >
> >Well, we were on a roll with breaking the build and just didn't see a
> >need to stop ... fixed this one in r4866.  There may be others.
> >
> 
> It is Python specific since it uses "numinputs=0", thus relying on
> t_output_helper to return the result in a tuple.
> 
> In Java, the binding must/should work by returning the output variable
> in a in/out parameter, which is done by using an array of
> SWIGTYPE_p_apr_file_t of length one - SWIG does this automatically,
> but the typemap above overrides (incorrectly).
> 
> 
> I'm sorry if my patches otherwise broke the build - I hadn't imagined
> that it could hurt the Python binding to add the qualifier.
> 
> 
> I'd better install Python here and test with it in the future.

Jesper, though it was me who rolled back this portion of your patch,
would you mind correcting it?  You seem to have a good handle on SWIG.
Thanks!

- Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 4848 - trunk/subversion/bindings/swig

Posted by Greg Stein <gs...@lyra.org>.
On Thu, Feb 13, 2003 at 10:21:20AM +0100, Jesper Steen Møller wrote:
> Daniel Rall wrote:
>...
> >Well, we were on a roll with breaking the build and just didn't see a
> >need to stop ... fixed this one in r4866.  There may be others.
>
> It is Python specific since it uses "numinputs=0", thus relying on 
> t_output_helper to return the result in a tuple.
> In Java, the binding must/should work by returning the output variable 
> in a in/out parameter, which is done by using an array of 
> SWIGTYPE_p_apr_file_t of length one - SWIG does this automatically, but 
> the typemap above overrides (incorrectly).

Ah. Thanks, that clears it up a lot.

> I'm sorry if my patches otherwise broke the build - I hadn't imagined 
> that it could hurt the Python binding to add the qualifier.

Nah, it didn't break the build. Dan was just poking fun at himself for an
earlier breakage. I was concerned that the change would eliminate
functionality for the Java code... heh :-)

> I'd better install Python here and test with it in the future.

I wouldn't worry about it, really. We've got Python eyeballs on it if you'd
rather skip the Python stuff and just concentrate on the Java code.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 4848 - trunk/subversion/bindings/swig

Posted by Jesper Steen Møller <je...@selskabet.org>.
Daniel Rall wrote:

>Greg Stein <gs...@lyra.org> writes:
>  
>
>>On Tue, Feb 11, 2003 at 05:57:46PM -0600, dlr@tigris.org wrote:
>>    
>>
>>>...
>>>+++ trunk/subversion/bindings/swig/apr.i	Tue Feb 11 17:57:29 2003
>>>...
>>> /* -----------------------------------------------------------------------
>>>   handle apr_file_t *
>>> */
>>>@@ -153,7 +162,7 @@
>>>    apr_file_t ** is always an OUT param
>>> */
>>> 
>>>-%typemap(in,numinputs=0) apr_file_t ** (apr_file_t *temp)
>>>+%typemap(python, in, numinputs=0) apr_file_t ** (apr_file_t *temp)
>>>     "$1 = &temp;";
>>>      
>>>
>>I see nothing Python specific there. Why was this change made?
>>    
>>
>
>Well, we were on a roll with breaking the build and just didn't see a
>need to stop ... fixed this one in r4866.  There may be others.
>  
>
It is Python specific since it uses "numinputs=0", thus relying on 
t_output_helper to return the result in a tuple.
In Java, the binding must/should work by returning the output variable 
in a in/out parameter, which is done by using an array of 
SWIGTYPE_p_apr_file_t of length one - SWIG does this automatically, but 
the typemap above overrides (incorrectly).

I'm sorry if my patches otherwise broke the build - I hadn't imagined 
that it could hurt the Python binding to add the qualifier.

I'd better install Python here and test with it in the future.

-Jesper



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 4848 - trunk/subversion/bindings/swig

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Greg Stein <gs...@lyra.org> writes:

> On Tue, Feb 11, 2003 at 05:57:46PM -0600, dlr@tigris.org wrote:
> >...
> > +++ trunk/subversion/bindings/swig/apr.i	Tue Feb 11 17:57:29 2003
> >...
> >  /* -----------------------------------------------------------------------
> >    handle apr_file_t *
> >  */
> > @@ -153,7 +162,7 @@
> >     apr_file_t ** is always an OUT param
> >  */
> >  
> > -%typemap(in,numinputs=0) apr_file_t ** (apr_file_t *temp)
> > +%typemap(python, in, numinputs=0) apr_file_t ** (apr_file_t *temp)
> >      "$1 = &temp;";
> 
> I see nothing Python specific there. Why was this change made?

Well, we were on a roll with breaking the build and just didn't see a
need to stop ... fixed this one in r4866.  There may be others.
-- 

Daniel Rall <dl...@finemaltcoding.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org