sig MakeString as String class X def main s = .stringForInt(5, do='5') assert s == '5' s = .stringForInt(5, do='5') assert s == '5' s = .stringForInt(3, do=_makeString(3)) # used to bug out here var _cache = Dictionary() def stringForInt(i as int, makeString as MakeString) as String if _cache.containsKey(i) return _cache[i] else s = makeString() _cache[i] = s return s def _makeString(i as int) as String return i.toString