Edit: prod(range(1, n+1)) does work
4,204 karma · joined March 28, 2013
Edit: prod(range(1, n+1)) does work
from math import prod # from Python 3.8 onwards
def factorial(n):
return prod(range(n+1))Often but not always the case
Edit: at least not in SQL, and therefore SQL databases. If the language being described here isn't actually SQL, that could still be a problem.
> 1. trivially copyable (: Copy if we speak in Rust)
> 2. trivially destructible (i.e. they can't have impl Drop)
2 (Drop) seems obvious enough, but why 1 (Copy)? There’s a bit of Rust knowledge implicit there that I’m unaware of, and I might not be alone in that. Could someone explain?
Edit: https://en.wikipedia.org/wiki/Autopoiesis https://en.wikipedia.org/wiki/Coevolution
Read on a bit and it looks like proof by contradiction:
> However, let’s bring back the paradox we discussed above. According to that paradox, U cannot exist or U cannot provide shorter descriptions than every arbitrary L.
On the flip side, type systems bring at least some sense of proof into programming.
There was some detail in its announcement in January: https://gleam.run/news/gleams-new-interactive-language-tour/
Edit: From what I can tell, standardised in Fortran 90, presumably older than that.