News for hackers. Stuff that matters.
Re:Phoenix 1.3 is pure love for API development by hlieberman on Saturday March 04, 2017 @10:40AM (#13791302)
I mean, if you want something really compact, why not APL?

      +/{(0=2|⍵)×⍵*2}⍳4
20

Edit: My point here, besides simply the joy of trolling, is that "compactness" isn't a great metric for analyzing a programming language, or a framework even. My APL example isn't very compact for APL, yet it's certainly /way/ more compact than the Python, Elixir, or Ruby versions.

Still, it's hardly comprehensible to me as a beginner APL programmer -- and I wrote it, just now. It's probably /completely/ incomprehensible to anyone who hasn't written APL before. Is APL still "better", going only by compactness?

Re:Phoenix 1.3 is pure love for API development by klibertp on Saturday March 04, 2017 @11:38AM (#13791587)
The same in J:

    +/*~((0&=&(2&|))@:[#])(1+i.4)
    20
It's longer than APL version, but still cute! :)