digitalmars.D.learn - What is iota function full name
- lili (2/2) Jun 21 2019 Hi Guys:
- aliak (5/7) Jun 21 2019 That is the full name. Or what do you mean?
- lili (6/13) Jun 21 2019 😄 I mean is that the what is iota stands for.
- Andrea Fontana (3/7) Jun 21 2019 Full answer:
- Jonathan M Davis (16/18) Jun 21 2019 iota _is_ its full name. It's named after an STL function which does
- KlausO (2/25) Jun 21 2019
- JN (4/9) Jun 21 2019 I don't even understand why get so much inspiration from C++. Why
- Jonathan M Davis (27/37) Jun 21 2019 Quite a lot of the functions in std.algorithm (especially the functions ...
- KnightMare (7/11) Jun 21 2019 auto terribleName( ... ) { }
- Marco de Wild (4/15) Jun 21 2019 Good tip. I usually make a file for these kind of aliases and
- KnightMare (3/8) Jun 21 2019 hmm.. I have a question: this pragma will inline terribleName
- Jonathan M Davis (7/18) Jun 21 2019 pragma(inline, true) goes on function declarations, not on function call...
On Friday, 21 June 2019 at 09:01:17 UTC, lili wrote:Hi Guys: What is range.iota function full nameThat is the full name. Or what do you mean? Found on the internet somewhere: "The function is named after the integer function ⍳ from the programming language APL."
Jun 21 2019
On Friday, 21 June 2019 at 09:09:33 UTC, aliak wrote:On Friday, 21 June 2019 at 09:01:17 UTC, lili wrote:😄 I mean is that the what is iota stands for. in dictionary iota means: a tiny or scarcely detectable amount the 9th letter of the Greek alphabet but this function is not that mean.Hi Guys: What is range.iota function full nameThat is the full name. Or what do you mean? Found on the internet somewhere: "The function is named after the integer function ⍳ from the programming language APL."
Jun 21 2019
On Friday, 21 June 2019 at 09:24:54 UTC, lili wrote:in dictionary iota means: a tiny or scarcely detectable amount the 9th letter of the Greek alphabet but this function is not that mean.Full answer: https://stackoverflow.com/questions/9244879/what-does-iota-of-stdiota-stand-for
Jun 21 2019
On Friday, June 21, 2019 3:01:17 AM MDT lili via Digitalmars-d-learn wrote:Hi Guys: What is range.iota function full nameiota _is_ its full name. It's named after an STL function which does basically the same with iterators in C++: https://en.cppreference.com/w/cpp/algorithm/iota Apparently, C++ got it from the APL programming language, which uses Greek characters and other symbols that you can't find on most keyboards, which makes APL code more like what you see in equations in a math textbook, and APL uses the Greek letter iota for a function with similar behavior to the C++ and D functions. And since unlike APL, C++ couldn't use the Greek letter, when they named their version of the function, they used the name of the letter rather than the letter. And then D's function name was named after the C++ function. So, iota is the name of the function, and it doesn't stand for anything. It's just the name of the Greek letter that was used for a similar function in another language that most programmers these days have probably never heard of. - Jonathan M Davis
Jun 21 2019
So basically iota spills Increments Over The Array. Am 21.06.2019 um 11:18 schrieb Jonathan M Davis:On Friday, June 21, 2019 3:01:17 AM MDT lili via Digitalmars-d-learn wrote:Hi Guys: What is range.iota function full nameiota _is_ its full name. It's named after an STL function which does basically the same with iterators in C++: https://en.cppreference.com/w/cpp/algorithm/iota Apparently, C++ got it from the APL programming language, which uses Greek characters and other symbols that you can't find on most keyboards, which makes APL code more like what you see in equations in a math textbook, and APL uses the Greek letter iota for a function with similar behavior to the C++ and D functions. And since unlike APL, C++ couldn't use the Greek letter, when they named their version of the function, they used the name of the letter rather than the letter. And then D's function name was named after the C++ function. So, iota is the name of the function, and it doesn't stand for anything. It's just the name of the Greek letter that was used for a similar function in another language that most programmers these days have probably never heard of. - Jonathan M Davis
Jun 21 2019
On Friday, 21 June 2019 at 09:18:49 UTC, Jonathan M Davis wrote: So, iota isthe name of the function, and it doesn't stand for anything. It's just the name of the Greek letter that was used for a similar function in another language that most programmers these days have probably never heard of. - Jonathan M DavisI don't even understand why get so much inspiration from C++. Why not just name it seq or sequence?
Jun 21 2019
On Friday, June 21, 2019 5:10:03 AM MDT JN via Digitalmars-d-learn wrote:On Friday, 21 June 2019 at 09:18:49 UTC, Jonathan M Davis wrote: So, iota isQuite a lot of the functions in std.algorithm (especially the functions that it got early on) are modeled after similar functions in C++, standard library, and when Andrei wrote those functions, he purposefully made them use the same names as they have in C++. For anyone already familiar with those functions in C++ (including iota), having the same names makes sense. Other people are more likely to look at the names on their own merits, and as such, the names don't necessarily make as much sense (particularly iota). Regardless, given that Andrei was heavily involved in C++ long before he got involved with D, it's not exactly surprising that he'd use the C++ names rather than coming up with new ones - especially when std.algorithm was originally heavily modeled after C++'s algorithm header. Some folks argued a while back that iota was a terrible name and that it should be changed, but it was decided not to change it. However, truth be told, if you know what iota is, the name is more descriptive than a more generic name like sequence or generateRange would be. It's just a terrible name from the perspective that it's not at all decriptive of what it is. It's just a name that has historically been used for this particular operation. In practice, what tends to happen is that when someone first encounters iota, they think that it's a terrible name, but in the long run, they just know what it is, and it isn't actually a problem. Either way, at this point, names in Phobos don't get changed just because some folks think that a name isn't as good as it could be or should be, because changing would break code, and Walter and Andrei do not believe that simply giving something a better name is worth breaking anyone's code. - Jonathan M Davisthe name of the function, and it doesn't stand for anything. It's just the name of the Greek letter that was used for a similar function in another language that most programmers these days have probably never heard of. - Jonathan M DavisI don't even understand why get so much inspiration from C++. Why not just name it seq or sequence?
Jun 21 2019
On Friday, 21 June 2019 at 12:02:10 UTC, Jonathan M Davis wrote:On Friday, June 21, 2019 5:10:03 AM MDT JN viaSome folks argued a while back that iota was a terrible name and that it should be changed, but it was decided not to change it.auto terribleName( ... ) { } auto goodName( ... ) { pragma( inline, true ) return terribleName( ... ); } everyone is happy
Jun 21 2019
On Friday, 21 June 2019 at 19:18:02 UTC, KnightMare wrote:On Friday, 21 June 2019 at 12:02:10 UTC, Jonathan M Davis wrote:Good tip. I usually make a file for these kind of aliases and simple functions that do not end up in the standard library, eg std.algorithm oneliners.On Friday, June 21, 2019 5:10:03 AM MDT JN viaSome folks argued a while back that iota was a terrible name and that it should be changed, but it was decided not to change it.auto terribleName( ... ) { } auto goodName( ... ) { pragma( inline, true ) return terribleName( ... ); } everyone is happy
Jun 21 2019
On Friday, 21 June 2019 at 19:18:02 UTC, KnightMare wrote:On Friday, 21 June 2019 at 12:02:10 UTC, Jonathan M Davis wrote:auto goodName( ... ) { pragma( inline, true ) return terribleName( ... ); }hmm.. I have a question: this pragma will inline terribleName (double code) or goodName (fine)?
Jun 21 2019
On Friday, June 21, 2019 3:31:46 PM MDT KnightMare via Digitalmars-d-learn wrote:On Friday, 21 June 2019 at 19:18:02 UTC, KnightMare wrote:pragma(inline, true) goes on function declarations, not on function calls. So, you would need to put it on goodName's signature, in which case, it's goodName which would be inlined. There is no way for a caller to force a function to be inlined. - Jonathan M DavisOn Friday, 21 June 2019 at 12:02:10 UTC, Jonathan M Davis wrote: auto goodName( ... ) { pragma( inline, true ) return terribleName( ... ); }hmm.. I have a question: this pragma will inline terribleName (double code) or goodName (fine)?
Jun 21 2019