October 30, 2009 oslofeaturedcontent

Sweet State Machine DSL in M”

Kevin D. Wolf has built a sweet little language to describe state machines:

The States of a Invoice are New, Reviewed, Submitted, Paid, Overdue and Canceled.

An Invoice can transition from New to Reviewed and Canceled.
An Invoice can transition from Reviewed to Submitted and Canceled.
An Invoice can transition from Submitted to Paid, Overdue and Canceled.
An Invoice can transition from Overdue to Paid and Canceled.

He built this with a language definition in M”. What could be simpler?