Skip to content
Laeeth Isharc edited this page Mar 19, 2015 · 1 revision

Table of Contents

Going Forward

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.

Older API Changes

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:

Operator Overloading

It was automatic. It is now explicit.

Reflected operator overloading is now supported.

See Class Wrapping for details.

Init

Init parameters were once written

Now they are written

def

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

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

naming convention

Many functions in pyd have been renamed to enforce the following naming convention:

  • functions: lowercase_with_underscores
  • templates, classes, etc: CamelCase
Clone this wiki locally