def plus2(x, y): h1 = make_cell(x) h2 = make_cell(y) increment(h1) increment(h2) increment(h1) increment(h2) return cell_get(h1), cell_get(h2)
def plus(x, y): h = make_cell(x) i = y while i > 0: increment(h) i = i - 1 return cell_get(h)
def plus4(x): h = make_cell(x) increment(h) increment(h) increment(h) increment(h) return cell_get(h)
def plus(h, y): i = y while i > 0: increment(h) i = i - 1 return cell_get(h)
def length(h, xs): if not isinstance(xs, Empty): increment(h) length(h, xs.tail) return cell_get(h)
def increment(h): return cell_set(h, add_one(cell_get(h)))
def value(self): return cell_get(self._count)
def increment(self, inc): curr = cell_get(self._count) rval = curr + inc cell_set(self._count, rval) return rval