I am new to the study of functional paradigm. If this question is academic
please bear with me.

How would I make this counter with lambda or -> without deferring to a named
generator method or sigil var?

my ruby version:

%  ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30907)

my code examples for explanation:

% irb
>> closed = Proc.new( over=0){over+=1}
 => #<Proc:0x00000001300e98@(irb):10>
 >> 4.times { puts closed[] }
1
2
3
4
 => 4

error out on  lambda

>> closed = lambda( over=0){over+=1}
ArgumentError: wrong number of arguments(1 for 0)
...

and -> doesn't error but give undesired results:

>> closed = ->( over=0){over+=1}
 => #<Proc:0x00000001234d20@(irb):16 (lambda)>

>> 4.times { puts closed[] }
1
1
1
1
 => 4

in a named method I relize I can use a named method with argument being
bound while returning with either -> or lamda. for example:

def closure( over=0) lambda{over+=1} end
def closure( over=0) ->{over+=1} end

closed = closure

both of these will work. I am just curious if there is a way to accomplish
the same thing without method name definition i.e anonymous function.