Flexible Default Function Parameters via structs with Nullable Fields

Posted on

The problem Sometimes we need to combine an aggregate of a set of values with an aggregate of the corresponding set of default values to create a combined result. The result for each member is either the explicitly specified value or, where no value is specified, the default value. This is similar to default function … Continue reading Flexible Default Function Parameters via structs with Nullable Fields

Read more...

Memoization in the D Programming Language

Posted on

The D programming language provides advanced facilities for structuring programs logically, almost like Python or Ruby, but with high performance and the higher reliability of static typing and contract programming. In this article, I will describe how to use D templates and mixins for memoization, that is, to automatically remember a function (or property) result. … Continue reading Memoization in the D Programming Language

Read more...

Writing a D Wrapper for a C Library

Posted on

In porting to D a program I created for a research project, I wrote a D wrapper of a C library in an object-oriented manner. I want to share my experience with other programmers. This article provides some D tips and tricks for writers of D wrappers around C libraries. I initially started my research … Continue reading Writing a D Wrapper for a C Library

Read more...