3 ms·
The syntax seems perfectly reasonable, or even natural, to me. Perhaps you're over-thinking the specifics, or are too used to other functional programming langu
by halo 18y ago
The syntax seems perfectly reasonable, or even natural, to me. Perhaps you're over-thinking the specifics, or are too used to other functional programming languages where 'reduction' has a slightly different, more specific, meaning (i.e. fold).
[+] 1...5 = 1+2+3+4+5
[*] 1...5 = 1*2*3*4*5
[**] 1...5 = 1**2**3**4**5
[<] 1...5 = 1<2<3<4<5
Note that this means, unlike the normal reduce, that it follows the operator's default precedence rules, and presumably the less-than operator works similarly to Python's in that it allows comparison chaining (i.e. 1 < 2 < 3 works as you'd expect) to make the result using reduce seem natural.
- deleted 18y ago[deleted]