Talk:First-class function: Difference between revisions

Content deleted Content added
Sectioning and indenting
Line 76:
g.call(2) #=> 6
g[2] #=> 6
g.(2) #=> 6 (only works in ruby 1.9, its a new syntax)
g.class #=> 'Method'
proc = g.to_proc # returns the method as a Proc