From: Stu Date: 2011-04-20T15:03:29+09:00 Subject: Re: anonymous closures with Proc,new, lambda and -> --0016369f9b180f742a04a1536224 Content-Type: text/plain; charset=ISO-8859-1 Lots of helpful information in this thread. Thank you all for helping me. Since I am new to functional programming I am slowly experimenting with what I know and building slowly from there. In the same fashion that object oriented is no more than the sum of it's parts I am interested in learning as much as I can about this paradigm. I understand the concept of closure. I imagine the best use for it would be to build one and embed it in another and so one( correct me if I'm wrong) I have read and experimented with ruby's Proc#curry method. There is a tutorial online which explains haskell's monads in ruby I plan on grokking as well. Are there any other facets of functional programming theory I should look at to take advantage of? On Tue, Apr 19, 2011 at 9:28 PM, 7stud -- wrote: > 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/. > > --0016369f9b180f742a04a1536224--