Lisp Adventures #2 - One, Two, Three... Infinity
Imagine you want to count the sum of the numbers from 1 to 1,000,000,000 (one billion). If you come from an imperative programming background, you might be already thinking on a loop and what number type to hold that value. You might come up with something similar to this if you’re writing C: uint64_t sum = 0; for (int i = 1; i <= 1000000000; i++) sum += i; printf("%lu\n", sum); Good, it runs quite fast and we get the solution.