logoalt Hacker News

SideQuarklast Sunday at 10:51 AM1 replyview on HN

… which needs a terminating case, which cannot be not defined as the same recursion.


Replies

erulast Sunday at 11:53 PM

When talking informally, people often omit mentioning the base case when it's obvious or trivial.

Btw, your recursion doesn't necessarily need a terminating case.

See eg this definition of the list of Fibonacci numbers in Haskell:

    fibs :: [Integer]
    fibs = 1 : 1 : zipWith (+) fibs (tail fibs)
show 2 replies