I have recently started using Dlang, hence this basic question.
Thanks for your insight.
On Sunday, 2 June 2019 at 15:48:54 UTC, Rnd wrote:
I have recently started using Dlang, hence this basic question.
Thanks for your insight.
map and filter are templates in D, and !(...) is D's syntax for
passing arguments to templates:
map!(x => x*x)([1, 2, 3, 4, 5])
^ ^
|
On Sunday, 2 June 2019 at 15:48:54 UTC, Rnd wrote:
I have recently started using Dlang, hence this basic question.
Thanks for your insight.
To know more about D you should take the time to do the D tour
[1] which provides you with general knowledge of most of D's
functionalities and vocabular
On Sunday, 2 June 2019 at 15:55:46 UTC, Paul Backus wrote:
On Sunday, 2 June 2019 at 15:48:54 UTC, Rnd wrote:
I have recently started using Dlang, hence this basic
question. Thanks for your insight.
map and filter are templates in D, and !(...) is D's syntax for
passing arguments to templates
On Sunday, 2 June 2019 at 16:39:57 UTC, Rnd wrote:
Is it not possible in the language to have template map
function also to called as map(x=>... ?
It could be done pretty easily, but you will have to learn what
template arguments are eventually anyway. You'll see this pattern
all over, like `
On Sunday, 2 June 2019 at 16:39:57 UTC, Rnd wrote:
Is it not possible in the language to have template map
function also to called as map(x=>... ?
This will reduce complexity which will attract more people to
this language.
Easy languages have great mass appeal as has been shown with
Ruby
On Sunday, 2 June 2019 at 16:39:57 UTC, Rnd wrote:
Is it not possible in the language to have template map
function also to called as map(x=>... ?
That would be slower, and std.algorithm generally disallows easy
but slow functions.
In Java, you can sort a linked list. In D, sort requires an