Stu wrote in post #993854:
> how would i break it down to two functions?


Is this what you are looking for:

inc = lambda do
  n = 1
  lambda{n += 1}
end.call

counter = lambda{inc.call}
puts counter[]
puts counter[]

--output:--
2
3

-- 
Posted via http://www.ruby-forum.com/.