Starman

I started a Haskell course last week. One of this week’s exercises was to write a guessing game called Starman. All the necessary code fragments were provided in the course notes and a complete solution was provided on github. However, in the spirit of learning by doing I re-jigged the program structure a bit. I’m… Continue reading Starman

The Quartermaster’s Store

My eyes are dim, I cannot see. I have not brought my specs with me. Mission Impossible? It’s said you can find anything in the Quartermaster’s Store, even impossible things like fairy wings and unicorn tears. So that’s where I went to find some virtual function templates. The quartermaster is an old man now. His… Continue reading The Quartermaster’s Store

Visiting Alice

“The time has come,” the Walrus said, “To talk of many things: Of tuples, trees and composites; Of visitors and kings.”1 Welcome “Good morning, everyone, and welcome to the Wonderland Social Club annual treasure hunt. I am the Walrus.” (coo-coo coo-choo) “Well, not a walrus, but I am quite long in the tooth.” (groan) “This… Continue reading Visiting Alice

Grain Storage MIS: A Failure of Communications

Introduction In the early 1980s I was given full responsibility for a software development project for the first time. A Northumbrian farmer bought, sold and stored grain on behalf of other farmers. The Sunday colour supplements were writing about the new “micro-computers” and this farmer saw an opportunity to automate the administration of his business.… Continue reading Grain Storage MIS: A Failure of Communications

The Curious Case of the Compile-Time Function

A Crime Has Been Committed 18 months ago I described a version of my Event/Callback library in an Overload article [Bass]. This library is used extensively in my employer’s control systems software. A typical use looks like this: // A class of objects that monitor some event. class Observer { public: Observer(Event& event) : callback(bind_1st(memfun(&Observer::handler),… Continue reading The Curious Case of the Compile-Time Function

Implementing the Observer Pattern in C++ – Part 2

In part 1 of this article I presented an Event/Callback library intended to support the Observer pattern and hinted that it had some limitations. The library was based on the following Event class template: template<typename Arg> class Event { public: // Iterator type definition. typedef … iterator; // Destroy an Event. ~Event(); // Attach a… Continue reading Implementing the Observer Pattern in C++ – Part 2