Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 Oct 1999
Online Last Active Today, 01:47 AM

Journal Entries

D Bits > D Tip: Use Scope Statements in Proper Scope

Posted 03 November 2013

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...

D Bits > Functional Me

Posted 23 January 2013

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...

D Bits > Binding D to C Part Five

Posted 31 December 2012

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...

D Bits > Fun with GCC (or A Lesson Relearned)

Posted 22 December 2012

This story has nothing really to do with D except peripherally, but it's a tale worth telling as a warning to others.This is the best place for me to tell it.I had a collection of C code that I'd built up over the years. I suppose I still have it, but it's sitting on the hard drive of a closeted dormant computer that I don't want to bother setting up. Bes...

D Bits > TicTacToe and Modules in D

Posted 02 December 2012

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...