this is fibonacci written in Random++

f: @!$,.1,1^%#(*

very elegant and short :-)


> --- Ursprgliche Nachricht ---
> Von: Christian Neukirchen <chneukirchen / gmail.com>
> 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 <snail / objmedia.demon.co.uk> writes:
> 
> > In message <m28xunjx8g.fsf / lilith.local>, Christian Neukirchen
> > <chneukirchen / gmail.com> 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  <chneukirchen / gmail.com>  http://chneukirchen.org
>