p = Proc.new {|n| n } p.call(1) #ok, returns 1
#this is ok too def j(i) p = Proc.new {|n| return n; } p.call(i) end j(1) #ok - returns 1
#and ok with lambda p = lambda {|n| return n; } p(1) #ok, lambda lets caller stay in control
p = Proc.new {|n| n } p.call(1) #ok, returns 1
#this is ok too def j(i) p = Proc.new {|n| return n; } p.call(i) end j(1) #ok - returns 1
#and ok with lambda p = lambda {|n| return n; } p(1) #ok, lambda lets caller stay in control
Please visit orbit.love to subscribe to articles about developer relations, marketing, and community.
You can subscribe to this blog directly via the RSS feed.
Thanks! 🙏