10 ms·
> I am familiar enough with functional programming patterns. Really? I've never used rust but the code was pretty clear to me except for the >> shift part. >
by shmageggy 10y ago
> I am familiar enough with functional programming patterns.
Really? I've never used rust but the code was pretty clear to me except for the >> shift part.
> But I think I would be able to understand the snippet in most imperative and functional languages.
In Python (ignoring the shift thingy) I'd write
prediction = sum(map(lambda c, s: c*s, zip(coefficients, buffer[i-12: i])))
To me, both are equally clear