alist .sort .map!(x => x * x) .map!(x => x - x/2) .map!(x => x + 1);
This seems like what you're asking. Each of those is a template. And while this is all logic code, D has inferred the type aka: SortedRange!Map!Map!Map
With some details removed.
39 karma · joined June 17, 2009
alist .sort .map!(x => x * x) .map!(x => x - x/2) .map!(x => x + 1);
This seems like what you're asking. Each of those is a template. And while this is all logic code, D has inferred the type aka: SortedRange!Map!Map!Map
With some details removed.
D has me fooled and I can't imagine Go choosing to go further in D's direction over C#. I feel sorry for them.
I have some potential coming up to do some Typescript, it will be interesting to find out how to transfer my experience into this language.
I have not utilized tagged unions outside this type so I'm not one to comment on any deficiency.
Restructuring and formatting can come in as post edits.
There is currently a rewrite in the works.
You can even have multiple protected branches where "policy makers" merge the work from their lawyer.
The president is the commander an chief of the military, it seems reasonable he would not be allowed to quarter his troops in peoples homes.
Take a look at this one
https://github.com/JesseKPhillips/USA-Constitution/commit/0c...
It is funny how Go sold it as a feature, but it was always a deficiency in D (and yes, it just happened out of the box.)
That isn't to say C dynamic libraries didn't work, that is a linker thing, but it would be the same in Go.
And appearance really only changes when you hit templates. And with D you can't tell (as an outsider) so it just looks like the non templated C++.
But their is real nice clarit in what you want at its foundation.
On another note
[Flashing Block here]
For example, Go is praised for being a simple language that everyone can learn quickly, yet when someone shows what they picked up "that isn't how you do it."
I get that it is one thing to get something done, and another to learn an idiomatic approach. But when the sort package is hailed as the example for both why Go doesn't need generics and Go does need generics, I think it is safe to say that even the language creators don't know how to use Go.
Having to tell the standard library how to swap data in a slice and to obtain a slices length is simple... why doesn't the standard library know how to work with basic types? This way I don't end up writing by accident:
func (a ByAge) Swap(i, j int) { a[i], a[j] = a[j], a[j] }