From: Sebastian Hungerecker Date: 2009-07-13T03:40:33+09:00 Subject: Re: one line sorting Am Sonntag 12 Juli 2009 20:20:09 schrieb Haris Bogdanovic: > >I really can't get what it is you're trying to do here? > > Just practicing functional programming in Ruby. Your sort method isn't really what most people would consider functional programming, being that it relies on mutating the array (and the each-method which isn't even present in purely functional languages being that it needs side-effects to have any effect at all). If you want to implement a sort method in functional style, you should consider doing a recursive quick sort, which is quite simple and can be done in one line if you don't count the "def foo()" and "end" as their own lines. Also functional programming does not equal "one line". There's nothing wrong with spreading it out over multiple lines for readability. HTH, Sebastian