Skip to content

Instantly share code, notes, and snippets.

@JesseKPhillips
JesseKPhillips / csvtests.d
Created January 30, 2011 03:46
Unittests for csvRange
import csvRange;
import std.stdio;
void main() {
}
unittest {
@JesseKPhillips
JesseKPhillips / gist:774983
Last active September 24, 2015 16:18
Example of callcenter using parrallelfuture
module main;
import core.thread;
import std.algorithm;
import std.conv;
import std.datetime;
import std.parallelism;
import std.random;
import std.range;
import std.stdio;
@JesseKPhillips
JesseKPhillips / callcenter.d
Last active September 24, 2015 16:07
A translation of some code written in Go to demonstrate Goroutines.
/*
* Original Go: http://www.mprescient.com/journal/2011/1/9/concurrency-in-go-a-call-center-tutorial.html
*/
module main;
import core.thread,
std.array,
std.concurrency,
std.conv,
@JesseKPhillips
JesseKPhillips / lconst.d
Created November 30, 2010 02:54
Creating Safe Mutable members in a const/immutable object.
/**
* This code comes from a D newsgroup discussion by Max Samukha
* and Simen kjaeraas: http://thread.gmane.org/gmane.comp.lang.d.general/43408/focus=43476
*
* The intent is to provide a safe way to mutate some data in a const method.
*
* The rules to achieve this are:
* * Only mutable data can be assigned to a Mutable
* * Referenced fields can be modified (inner class fields, pointer target)
* * Value types can be modified if the encapsulating class