in reply to Re^5: How am i doing?
in thread How am i doing?

> Keep in mind that the classic MIT lectures on programming used to be in Lisp and original Lisp didn't have loops, only those "tail recursions".

I know pretty well, and that's not just Lisp. At $job-2, we had a significant codebase in Erlang, which doesn't have loops, either.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^7: How am i doing?
by LanX (Saint) on Jul 21, 2025 at 12:20 UTC
    IIRC Fibonacci was also heavily used to show the advantages of Haskell in one of the canonical books.

    But unfortunately I never went thru learning Haskell.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

      You can define an (infinite, FSVO infinite limited by your patience and available RAM) list without defining a new function, just summing itself with the rest of itself: fibs = 0 : 1 : zipWith (+) fibs (tail fibs), and then you can get the first however many you need with take. Once realized it won't have to recompute anything again.

      (I did have to crib from a wiki because I couldn't remember if it was just zip or not.)

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

      The nerf ball skirmish rages, "What is an apposite non-pedagogical example of recursion?" the casus belli; then, a pause: From a foxhole betwixt comes a plaintive query, "How about Quicksort?"