5 Apr
2018
5 Apr
'18
7:20 p.m.
On Thu, Apr 5, 2018, 5:32 PM Peter O'Connor
I find this a bit awkward, and maintain that it would be nice to have this as a built-in language construct to do this natively. You have to admit:
smooth_signal = [average = (1-decay)*average + decay*x for x in signal from average=0.]
Is a lot cleaner and more intuitive than:
dev compute_avg(avg, x): return (1 - decay)*avg + decay * x
The proposed syntax strikes me as confusing and mysterious to do something I do only occasionally. In contrast, itertools.accumulate() is straightforward and far more general. Definitely -100 on the proposal.