import std.stdio; struct Fib { private int _value; int value() { if(_value <= 2) return 1; scope f1 = Fib(_value - 1); scope f2 = Fib(_value - 2); return f1.value() + f2.value(); } } void main() { foreach (i; 0 .. 10) { scope x = Fib(40); writefln("n=", x.value); } }