Variation on Iota
6 points
4 days ago
| 2 comments
| toolofthought.com
| HN
mlochbaum
30 minutes ago
[-]
Ooh, I've run into this one before! I'm a big fan of interval index[0], which performs a binary search, so Josh's suggestion is the one I prefer as well (the implementation might sometimes optimize by transforming it into a table lookup like the other solutions). Searching for +`≠¨ in my BQN files turns up a few uses, including one used to group primitives into types in a utility involved in compiling BQN[1] and an annotated function used a few times in the markdown processor that builds BQN's website[2].

[0] https://aplwiki.com/wiki/Interval_Index

[1] https://github.com/mlochbaum/BQN/blob/717555b0db/src/pr.bqn#...

[2] https://github.com/mlochbaum/BQN/blob/717555b0db/md.bqn#L45-...

reply
xenonite
45 minutes ago
[-]
This is about the APL language.

std::iota is influenced by APL, see Notes in https://en.cppreference.com/w/cpp/algorithm/iota.html

reply