Printing shortest decimal form of floating point number with Mir

welkam wwwelkam at gmail.com
Mon Jan 4 22:14:12 UTC 2021


On Sunday, 3 January 2021 at 22:50:16 UTC, Ola Fosheim Grøstad 
wrote:
> YOU DO HAVE TO ACKNOWLEDGE A TYPE SYSTEM BUG!
>
> If an indirection through an alias causes type unification to 
> fail then that is a serious type system failure. No excuses 
> please...

Different people have different definitions of words. It's clear 
that your definition of bug does not match other people 
definition so instead of forcing other people to conform to your 
definition it would be beneficial if you could express your ideas 
using other words.

Secondly lets talk about

alias Bar!int = Foo!int;

or is it

alias Bar(T) = Foo!T;

Whatever. You want to alias template and assign a new name and 
then use the new name. Because you were not able to do that you 
say its obvious type system bug. I mean "You should be able to 
use whatever names you fancy without that having semantic 
implications". I guess type checking occurs during semantic 
analysis so its connected.

Anyway you want assign template name. Spoiler alert Bar!int is 
not a name. It's also not a type or even an object. You might 
used another term for how alias should work but I cant track them 
all. Its template instantiation.

Instead of
alias Bar!int = Foo!int;

use

alias Bar = Foo;
//or
alias Bar = foo!int;

for more read [1]

What you tried before was an attempt to assign template 
instantiation to another template instantiation or function call. 
If you want to assign name to name then write it that way.

When I got into personality types and typed myself I found out 
that my type doesnt respect physical world and details. And its 
true. I struggle with who where when. I some times get out of 
home without clipping my nails because I forgot to clip them. And 
I forgot because I was lost in my thoughts. Analyzing patterns is 
more important than being physically in the world. But what you 
displayed here is criminal neglect of details. There is 
difference between types, objects, names and symbols. There is 
difference between template declaration and initialization. There 
are differences between type system and language semantics. If 
you wont pay attention to these details ofcourse you will have 
problems communicating with people. And you failure to 
effectively communicate to others is not indication that its bad 
for D's future.

People say that you notice in others what you dont like in 
yourself.
1. https://dlang.org/spec/template.html#aliasparameters


More information about the Digitalmars-d-announce mailing list