import std.array: array; auto x = [long.max, 0, 1]; auto y = x.forwardDifference; version(print) dbg(y); // import msgpack; // version(print) dbg(y.pack); // version(print) dbg(y.array.pack);
https://stackoverflow.com/questions/21004944/forward-difference-algorithm
http://forum.dlang.org/thread/ujouqtqeehkegmtaxebg@forum.dlang.org#post-lczzsypupcfigttghkwx:40forum.dlang.org http://rosettacode.org/wiki/Forward_difference#D
Compute Forward Difference of range.
TODO Is there a difference between whether R r is immutable, const or mutable?
TODO If r contains only one element return empty range.