As I once again bemoaned D's lack of pattern matching yesterday,
I was inspired to create this[0] implementation, that plays to
D's strengths, allows for user-defined matching, and has a fairly
usable syntax. The core usage looks like this:
unittest {
auto a = tuple(1, "foo");
auto b = mat
On 12/03/16 14:12, Simen Kjaeraas wrote:
As I once again bemoaned D's lack of pattern matching yesterday, I was
inspired to create this[0] implementation, that plays to D's strengths,
allows for user-defined matching, and has a fairly usable syntax. The
core usage looks like this:
unittest {
On Saturday, 12 March 2016 at 20:56:47 UTC, Jacob Carlborg wrote:
On 12/03/16 14:12, Simen Kjaeraas wrote:
As I once again bemoaned D's lack of pattern matching
yesterday, I was
inspired to create this[0] implementation, that plays to D's
strengths,
allows for user-defined matching, and has a f
On Sunday, 13 March 2016 at 02:33:49 UTC, Simen Kjaeraas wrote:
http://dpaste.dzfl.pl/7360ee90b344
Dammit, 3:30AM was apparently too late, and some bad code leaked
through. I managed to sidestep a problem by writing nonsense
code. The problem I get can be reduced to this:
struct S {
voi
On 13/03/16 03:33, Simen Kjaeraas wrote:
The match function goes through the list of patterns and for each one
asks the tuple if opMatch returns true for that pattern. If it does, the
function assigned that pattern is called with the values assigned to args.
opMatch here is checking for each el