-
Notifications
You must be signed in to change notification settings - Fork 32
Changes
Changes to the API that ensure consistency across the various platforms that pyd intends to support are on the table. Otherwise, we will try to avoid change.
Since Pyd was originally written, D has evolved into a much more formidable language. For this and other reasons, the following changes have been made to Pyd's API:
It was automatic. It is now explicit.
Reflected operator overloading is now supported.
See Class Wrapping for details.
Init parameters were once written
Now they are written
def no longer has a MIN_ARGS param, and the parameters of def and most of the parameters of class_wrap have changed to a keyword style.
Example old:
Example new:
Notes
* fn must be the first argument; otherwise order of parameters does not matter. * fn_t is not wrapped by a template.
All function wrapping utilities now support default arguments and typesafe variadic arguments. Wrapped functions may now be called in python with keyword arguments.
conversion functions have been renamed. |**Old** | **New** | d_type | python_to_d | _py | d_to_python | PydObject.toDItem | PydObject.to_d | python_to_d | ex_python_to_d | d_to_python | ex_d_to_python
Many functions in pyd have been renamed to enforce the following naming convention:
- functions: lowercase_with_underscores
- templates, classes, etc: CamelCase