Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -1,14 +1,14 @@
import std.stdio, std.exception;
int fib(in uint arg) pure nothrow @safe @nogc {
assert(arg >= 0);
int fib(int arg) pure {
enforce(arg >= 0);
return function int (int n) pure nothrow {
auto self = __traits(parent, {});
return function uint(in uint n) pure nothrow @safe @nogc {
static immutable self = &__traits(parent, {});
return (n < 2) ? n : self(n - 1) + self(n - 2);
}(arg);
}
void main() {
import std.stdio;
39.fib.writeln;
}