Hacker News new | ask | show | jobs
by BugsJustFindMe 1772 days 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)).

2 comments

Yeah, 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

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.

Yes, a direct translation. (Using the reduction)