On Tuesday, 18 October 2016 at 15:41:29 UTC, Jesse Phillips wrote:
On Monday, 17 October 2016 at 20:13:19 UTC, Karabuta wrote:
I would suggest they remove all templates and make it its own
* Basic functional/ranges example = map, filter, reduce
* basic helloworld = write the string "Hello, World!"
* Basic sort example
* basic maths example
Template at times (implicit)
* basic UFCS example
Works with templates
It is very hard to use D and not instantiate a template for the
I've shown this to a colleague of mine a few days ago: he was
super confused by the ! operator. Then I told him it was D's
syntax for templates and everything made sense.
You can change the example to (here i left the same code of the
original one, but I agree with what the other said about it)
`// Round floating point numbers
import std.algorithm, std.conv, std.functional,
std.math, std.regex, std.stdio;
alias round = pipe!(to!real, std.math.round, to!string);
static reFloatingPoint = ctRegex!`[0-9]+\.[0-9]+`;
// Replace anything that looks like a real
// number with the rounded equivalent.
.map!(l => l.replaceAll!(c => c.hit.round)
If someone click on Explain, show
This example shows how easy it is to perform operations on data
in D in a quick overview of some general concepts which are
widespread in D.
You can see the byLine function being called without parenthesis
because it doesn't take any parameters in this case, the map
template being used with UFCS , taking a lambda as templated
parameter with D template syntax
the "each" template called with writeln as template parameter
without parenthesis because it's the only parameter taken.
To learn more about pipelining in D check out 
 page about that
Having 10 lines explaining what's going on in the code and
providing links to understand better can hook up a new user way
better than letting them do guess work. Moreover you can start
showing the documentation already, so they can start to be
familiar with where to search stuff