News for hackers. Stuff that matters.
Re:Translating math into code with examples in Java, Racket,... by mlevental on Tuesday May 28, 2019 @06:53PM (#20035208)
any sum with an index of summation requires mutability
Re:Translating math into code with examples in Java, Racket,... by chobytes on Tuesday May 28, 2019 @07:18PM (#20035373)
"requires" is a strong word. the only explicit definition ive seen given for n-ary summations and products products was recursive.
Re:Translating math into code with examples in Java, Racket,... by brianberns on Wednesday May 29, 2019 @09:05AM (#20039625)
I don't think so. For example, sum of first 5 integers:

    sum i = 1 to 5 of i -> 1 + 2 + 3 + 4 + 5 = 15
Nothing mutable there. In functional programming this is done with a `fold`, which doesn't use mutation.
Re:Translating math into code with examples in Java, Racket,... by pron on Wednesday May 29, 2019 @11:39AM (#20041448)
We're talking about notation. Anything could be described in any Turing complete language. It's uncommon to have something similar to mutation in ordinary mathematical notation, but summation is one example where it's used.