4 ms·
I don't think that the code the author listed for Paul Graham's Accumulator Challenge is correct. The challenge specifically states that its for a number not a
by TheMagicHorsey 14y ago
I don't think that the code the author listed for Paul Graham's Accumulator Challenge is correct. The challenge specifically states that its for a number not an integer, and its any incrementation, not addition. I'm not very familiar with Go, but it seems like the Go solution is not as general as the solutions in Lisp and other languages, where any operator and type can be used with the accumulator function.
I'm sure there is probably some way to implement the same thing in Go using duck typing. Just wanted to point out the difference though.