▲ | johnisgood a day ago | ||||||||||||||||||||||||||||||||||
> Are you serious? You are offended by the idea of reading documentation?This is not helping the credibility of your argument. Again, I'm not a D user, but this is just silly. If you knew me, and you read my comment history, you would have NEVER said that. It is not even a matter of reading the documentation or not. "idup" seems arbitrary, sorry, I meant the whole line sounds arbitrary. Why "a"? Why "a.idup"? Why "map!"? I was asking genuine questions. You do not have to bash me and see ghosts. I was curious as to why it was implemented the way it was. I am an active speaker against people who hate reading the documentation. And FYI, I love Perl[1] and OCaml[2]. [1] https://news.ycombinator.com/item?id=44359539 [2] You would have to check the comment history. | |||||||||||||||||||||||||||||||||||
▲ | schveiguy a day ago | parent | next [-] | ||||||||||||||||||||||||||||||||||
> Why "a" `a` is a parameter in the lambda function `a => a.idup`. > Why "map!" This is definitely something that can trip up new users or casual users. D does not use <> for template/generic instantiation, we use !. So `map!(a => a.idup)` means, instantiate the map template with this lambda. What map is doing is transforming each element of a range into something else using a transformation function (this should be familiar I think?) FWIW, I've been using D for nearly 20 years, and the template instantiation syntax is one of those things that is so much better, but you have to experience it to understand. > "idup" seems arbitrary Yes, but a lot of things are arbitrary in any language. This name is a product of legacy. The original D incarnation (called D1) did not have immutable data as a language feature. To duplicate an array, you used the property `dup`, which I think is pretty well understood. So when D2 came along, and you might want to duplicate an array into an immutable array, we got `idup`. Yes, you have to read some documentation, not everything can be immediately obvious. There are a lot of obvious parts of D, and I think the learning curve is low. | |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
▲ | quietbritishjim a day ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||
I think perhaps you are not realising the negative tone of your comments. There is no way to read "How is one supposed to know this? Reading the documentation?" except sarcasm. No amount of good faith in unrelated comment threads changes this. I believe that's why you're getting downvoted - not because people are easily offended about D, as you seem to believe. | |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
▲ | cxr a day ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||
> I am an active speaker against people who hate reading the documentation. How is one supposed to know this? | |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
▲ | a day ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||
[deleted] |