From: Peter Ertl Date: 2005-12-16T01:10:49+09:00 Subject: Re: ruby beats them all this is fibonacci written in Random++ f: @!$,.1,1^%#(* very elegant and short :-) > --- Urspr�ngliche Nachricht --- > Von: Christian Neukirchen > An: ruby-talk@ruby-lang.org (ruby-talk ML) > Betreff: Re: ruby beats them all > Datum: Fri, 16 Dec 2005 00:51:16 +0900 > > Stephen Kellett writes: > > > In message , Christian Neukirchen > > writes > >>def fib(n) > >> (1..n-2).inject([1, 1]) { |(a, b), n| [b, a+b] }.last > >>end > > > > Thats about as readable as APL. Maintenance nightmare. > > I disagree. APL isn't about readability to outsiders (and this is IMO > not a thing every language needs to strive for, sometimes there are > things more important). Take this piece of J: > > f =: 1:`($:@<:&<:+$:@<:)@.(1:<]) > > (taken from http://cubbi.org/serious/fibonacci/j.html) > Or, in K: > > fibonacci:{x(|+\)\1 1} > > (taken from > http://www.kuro5hin.org/?op=displaystory;sid=2002/11/14/22741/791) > > Or, again in K: > > fx:{x{x,+/-2#x}/0 1} > > (taken from http://www.kx.com/listbox/k/msg05165.html) > > These all are far more unreadable to me, even though I know the basics > of APL... > > Besides, what is there to maintain about fibonacci? > > > Stephen > -- > Christian Neukirchen http://chneukirchen.org >