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

I prefer J:

  +/>:i.100001
You could takeout the >: but then the range is 0 indexed and not 1-based:

  +/i.100001


Now that is incredibly terse. "/" is the J reducing function? Or is it not comparable?


It is J's 'insert' function. It inserts the verb on the left between the items on the right. I think I've see it called 'apply' for J too, and I think 'reduce' as defined in other functional languages would be correct; it's just that J calls it 'insert'.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: