long prevNum; bool enteringNewNum = true; long delegate(long a, long b) curOp; void onDigit(int d) { auto lab = Label(`.main.display`); char[] text; if (enteringNewNum || "0" == lab.text) { text = "" ~ cast(char)(d + '0'); enteringNewNum = false; } else { text = lab.text ~ cast(char)(d + '0'); } char[] convText = to!(char[])(to!(long)(text)); if (convText == text) { lab.text = text; } }