3 ms·
> a more direct translation into another language might look like: range(100).reduce(plus, 0) That's...uhh...one way to do it. But it's a lot shittier to read
by BugsJustFindMe 5y ago
> a more direct translation into another language might look like: range(100).reduce(plus, 0)
That's...uhh...one way to do it. But it's a lot shittier to read than sum(range(100)).
- rak1507 5y agoYes, a direct translation. (Using the reduction)
- jasonwatkinspdx 5y agoYeah, ever since running into this little snippet eons ago, I've found the symbols are better argument for APL style languages quite weak: http://nsl.com/papers/kisntlisp.htm http://nsl.com/papers/kisntlisp.htm Since the arity of all the primitives are known there's less parens than lisp. That seems like the clear sweet spot to me. And I think this is born out with K the product. One of the things they added with Q is a more text oriented syntax. The big a-ha in APL style languages is shifting from thinking about loops and iterating over single elements to transforming tensor like objects. It's a powerful approach no matter what language and syntax you use.