Commits

ariovistus committed 2e55d1a

oh yes we can skip default arguments!

Comments (0)

Files changed (1)

 * All calls to def must occur before calling module_init. 
 * Any function whose return type and arguments are convertible can be wrapped by def. 
 * def can only wrap functions with in arguments (not out or ref or lazy). 
-* def can handle functions with default and typesafe variadic (e.g. {{{void foo(T[]...)}}}) arguments. Currently, def cannot automatically fill in omitted default arguments.
+* def can handle functions with default and typesafe variadic (e.g. {{{void foo(T[]...)}}}) arguments. 
+* def supports skipping default arguments (on the python side) and will automatically fill in any omitted default arguments.
 * def-wrapped functions can take keyword arguments in python.
 
 def-wrapped functions can be called in python in the following ways:
 |**D function**                       | **Python call**
 | void foo(int i);                    | foo(1), foo(i=1)
 | void foo(int i, double d = 3.14);   | foo(1,2.0), foo(1), foo(i=1), etc
+| void foo(int i = 2, double d = 3.14 | foo(d=3.0)
 | void foo(int[] i...);               | foo(1), foo(1,2,3), foo([1,2,3]), foo(i=1), foo(i=[1,2,3])
-but not:
-|**D function**                       | **Python call**
-| void foo(int i = 2, double d = 3.14 | foo(d=3.0)
+
+
 ==Examples==
 {{{
 #!d