From: James Britt Date: 2008-06-29T08:34:08+09:00 Subject: Re: Lambda calculus & functional programming - the view from Ruby Philip Rhoades wrote: > People, > > I have a general understanding of lambda calculus & functional > programming but I want to know how Ruby fits into this paradigm - is > there a summary doc somewhere (preferably with concrete examples) - I > couldn't find anything. What are the advantages/disadvantages, > strengths/weaknesses etc of the approach? I am gradually getting a feel > for "the Ruby way" and I thought this might help the process. Well, right off the bat, Ruby allows for global state and side effects (i.e. variables really do vary, and even constants may not be so constant), so while you *could* (I think) do strict functional programming in Ruby, you would have to be pretty deliberate about it. And since Ruby is ostensibly a message-passing OOP, you might be fighting the language quite a bit. On the down side, even with all that no-side-effect effort, you still won't get the benefits of a type system as found in, say, Haskell. A strict functional style still may reduce bugs and make the code easier to reason about though. -- James Britt www.happycamperstudios.com - Wicked Cool Coding www.jamesbritt.com - Playing with Better Toys www.ruby-doc.org - Ruby Help & Documentation www.rubystuff.com - The Ruby Store for Ruby Stuff