From: pjb@... (Pascal J. Bourguignon) Date: 2009-01-11T02:24:33+09:00 Subject: Re: functional programming Martin DeMello writes: > On Sat, Jan 10, 2009 at 5:39 PM, Mike Gold wrote: >> >> I use functional-ness in ruby on a small scale, such as inside the >> implementation of a method, but no wider. For reasons I gave earlier, >> functional style is most applicable to flat arrays and hashes, and >> probably less so with more complex structures >> (http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/472e714cffa0f50c). > > There are two, not-really-identical things that people mean when they > speak of "functional programming" - programming via pure, > side-effectless functions, and programming via higher order functions. > The former doesn't really make sense for ruby, as several people have > pointed out, but the latter is a useful technique, and pretty well > supported. The interest of writting purely functionnal code is not relative to a language. It's the ease of doing so that is relative to the language. Purely functionnal code has the big advantage that once you've proved and/or tested it, absolutely nothing else in the program can impact the validity of this code: you will always get the same results for the same arguments. -- __Pascal Bourguignon__