Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's not really fair since J has a built-in function, but in J the gcd function is +.

   15 +. 10
5

The near-canonical example is the mean, which is not built in:

   mean =: +/%#
   mean 2 3 4 5
3.5

Other code is similarly terse. On http://projecteuler.net/ it's not uncommon to see one-line J solutions to problems where other languages have solutions from 20 to 50 or more lines of code.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: