node{ // Internal state variables defined at this level persists across evaluations int i; int *A = new int[0](); int outValue; int inValue; int nValue; void evaluate(Context ctx) { int a = nValue + 1; A[i] = inValue; if (i < a) { outValue = A[i + 1]; } else { outValue = A[i - nValue]; } i++; if (i>a) { i=1; } inValue = getValue(ctx); nValue = getValue(ctx); if (!isInputDirty(ctx)) return; emitValue(ctx, outValue); } }