On Saturday, 19 August 2017 at 18:33:37 UTC, WhatMeWorry wrote:
On Friday, 18 August 2017 at 20:39:38 UTC, angel wrote:
On Friday, 18 August 2017 at 02:38:15 UTC, WhatMeForget wrote:
[...]
This actually appears correct ...
The 1-st example:
Each call to makeCalculator() increments a static (i
On Saturday, 19 August 2017 at 18:33:37 UTC, WhatMeWorry wrote:
Or maybe another approach would be to ask, what type is the
compiler replacing auto with.
If you want to find out compile with `-vcg-ast`
On Friday, 18 August 2017 at 20:39:38 UTC, angel wrote:
On Friday, 18 August 2017 at 02:38:15 UTC, WhatMeForget wrote:
[...]
This actually appears correct ...
The 1-st example:
Each call to makeCalculator() increments a static (i.e. shared
among all makeCalculator() instances) variable - cont
On Friday, 18 August 2017 at 02:38:15 UTC, WhatMeForget wrote:
Can someone explain what is the difference between the two?
Thanks.
module gates;
import std.stdio;
import std.random;
alias Calculator = int delegate(int);
Calculator makeCalculator()
{
static int context = 0;
int randy
Can someone explain what is the difference between the two?
Thanks.
module gates;
import std.stdio;
import std.random;
alias Calculator = int delegate(int);
Calculator makeCalculator()
{
static int context = 0;
int randy = uniform(1, 7);
context++;
writeln("context = ", conte