Why is it Called iota? [duplicate]

感情迁移 提交于 2021-02-09 18:48:17

问题


C++11 introduced a function called iota. Which "Assigns to every element in the range [first,last) successive values of val, as if incremented with ++val after each element is written."

Can someone explain what "iota" means here though?

I looked up "iota" and it seems to have nothing to do with generating a range.


回答1:


Quoting this non-authoritative, but nonetheless correct, wiki:

The function is named after the integer function from the programming language APL.

In APL, the function (represented with the ninth letter of the Greek alphabet, iota) is used to create a zero-based array of consecutive, ascending integers of a specified length.




回答2:


It's a Greek letter used in mathematics to denote a set of consecutive numbers. Iota use in APL.




回答3:


This page has a very plausible-seeming explanation:

The Greek letter iota is used in the programming language APL to generate a sequence of consecutive integers.



来源:https://stackoverflow.com/questions/28411850/why-is-it-called-iota

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!