KennyTM~ wrote:
Nice. Meanwhile, I'd like an opSum() operator (∑ range) as well. It's primarily about syntax sugar: reduce!("a+b")(range) is so ugly. In practice, the most important case is the sum from 1 to n, which is an extremely common operation. reduce!("a+b")(iota(1,n+1)) is horribly ugly for something so fundamental. It's so ugly that noone uses it: you always change it to n*(n+1)/2. But then, n gets evaluated twice.

As amply illustrated, one can make this argument pro and con about any builtin operator. The waterfront real estate of builtin operators is extremely limited, so we need to be very parsimonious in allocating it. Candidates for builtin operators need to have a very high bar.

The question is, does ^^ clear that bar or not?

Reply via email to