[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: More cvs2svn broken in 0.17.0?

From: <dberlin_at_dberlin.org>
Date: 2003-01-24 08:36:58 CET

On Thursday, January 23, 2003, at 12:29 PM, cmpilato@collab.net wrote:

 Edward S. Marshall esm@logic.net writes:

 (warning, half-baked idea follows)

 Although, this does give me an interesting idea; a lot of functions
 optional arguments (optional in the sense that the argument is NULL if
 there's nothing to be passed). Is there any way that this could be
 to python's optional argument syntax (ie. foo(arg1, arg2=None)) in a
 semi-automated manner?

 Regarding the above: I don't think so.

Um, it specifically supports it:

4.4.8 Default/optional arguments
    SWIG supports default arguments in both C and C++ code. For example:

int plot(double x, double y, int color=WHITE);

  In this case, SWIG generates wrapper code where the default arguments
are optional in the target language. For example, this function could
be used in Tcl as follows :

% plot -3.4 7.5 # Use default value
% plot -3.4 7.5 10 # set color to 10

   Although the ANSI C standard does not allow default arguments,
default arguments specified in a SWIG interface work with both C and

Note: There is a subtle semantic issue concerning the use of default
arguments and the SWIG generated wrapper code. When default arguments
are used, the default values are emitted into the wrappers and the
function is invoked with a full set of arguments. This behavior is not
100% compatible with all uses of default arguments in C++. Please
refer to the C++ chapter for further details.

In other words, you just need to move the functions you want default
arguments for into an interface file, and specify the defaults there.

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 14 02:12:59 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.