News for hackers. Stuff that matters.
Re:Translating Mathematics into Code: Examples in Java, Pyth... by the_af on Tuesday February 10, 2015 @01:37AM (#9025705)
Dijkstra's shortest path: good point. There is obviously a purely functional implementation, but it's true that the most natural way of thinking about it involves assigning labels.

I disagree about the sum "loop". It's merely a notation, not an actual step by step operation. Unlike a traditional imperative language's variable, i's value cannot be changed. Whatever the actual expression of f, you know i is always the same within it. You could think of it this way: "for each value v from range m..n, introduce a new variable i at each step with value v, which we will use for the expression".

There are no comments on this comment yet.