Jump to content

  • Log In with Google      Sign In   
  • Create Account

D Bits



Extended Package Protection in D

Posted by Aldacron, in D 02 March 2016 - - - - - - · 1,966 views
dang
Since the D1 days, D has had a package protection attribute akin to Java's (though unlike Java, it is not the default). Applying package protection to any symbol in a module makes it accessible only to modules in the same package.module mylib.mypackage.mymodule;package struct MyStruct {...}class MyClass { package void doSomething() {...}}
Given the abo...


My New Book: Learning D

Posted by Aldacron, in D, Projects 29 November 2015 - - - - - - · 1,187 views

From late February up until about two weeks ago, I've had my head down over my keyboard working on a book about the D programming language for PACKT called 'Learning D'. The electronic version is currently available from the publisher's site for roughly half-price. Both kindle and print versions are available at Amazon , though not at the sale price....


D Tip: Use Scope Statements in Proper Scope

Posted by Aldacron, in D 03 November 2013 - - - - - - · 1,877 views
d language
One D construct I often use is the scope guard statement . This allows you to write code that executes when a scope exits under one of three circumstances: an exception is thrown, no exception is thrown, or always. Example:void main() { import std.stdio; scope( failure ) { writeln( "I only execute when the scope exits due to an exception bein...


Functional Me

Posted by Aldacron, in D, Me 23 January 2013 - - - - - - · 1,981 views

I recall very clearly the first time I ever saw a video game. It must have been in the summer of either '78 or '79, just before my 7th or 8th birthday. I walked into a local 7-11, just a short distance from my house, and was puzzled to see this big box surrounded by a bunch of older kids. Space Invaders. The first time I saw the screen, it blew my mind. I...


Binding D to C Part Five

Posted by Aldacron, in D, Binding to C 31 December 2012 - - - - - - · 2,726 views

This is the fifth and final part of a series on creating bindings to C libraries for the D Programming Language.In part one , I introduced the difference between dynamic and static bindings and some of the things to consider when choosing which kind to implement. In part two , I talked about the different linkage attributes to be aware of when declaring e...


TicTacToe and Modules in D

Posted by Aldacron, in D, Projects 02 December 2012 - - - - - - · 1,964 views

Given that my BorderWatch project has languished on github for months without any updates beyond the first few days of random hacking, it's going to be a while before it can serve as an example of game programming in D. So I had some free time recently and decided to do something different. I put together a simple TicTacToe game, that I call T3, and put...


Binding D to C Part Four

Posted by Aldacron, in D, Binding to C 05 August 2012 - - - - - - · 3,313 views

This is the fourth part of a series on creating bindings to C libraries for the D Programming Language.

In part one, I introduced the difference between dynamic and static bindings and some of the things to consider when choosing which kind to implement. In...


Uniform Function Call Syntax in D

Posted by Aldacron, in D 29 June 2012 - - - - - - · 9,903 views

Uniform Function Call Syntax (UFCS) is a feature of the D Programming Language that was finally implemented in all its glory in a recent compiler release. It has been available for use with arrays for quite some time, since the early days of D1. But now it is available for every...


Binding D to C Part Three

Posted by Aldacron, in D, Binding to C 19 May 2012 - - - - - - · 4,371 views

This is the (long overdue) third part of a series on creating bindings to C libraries for the D programming language.

In part one, I introduced the difference between dynamic and static bindings and some of the things to consider when choosing which kind to implement. In...


Setting Thread Affinity on Windows in D

Posted by Aldacron, in D 03 April 2012 - - - - - - · 1,907 views

When working with D's standard library, it is sometimes necessary to work around missing declarations in the core.sys.windows.windows module. It's a fairly big module as is, but it isn't all-inclusive. If you are doing any heavy-duty Windows development, you'll likely want a...






July 2016 »

S M T W T F S
     12
3456789
10111213141516
17181920212223
242526272829 30
31      

Recent Entries

PARTNERS