On Wednesday, 15 June 2016 at 09:40:39 UTC, Chris wrote:
But factually I don't:

That's just because your example isn't realistic. A realistic case in Python etc is where you accidentally assign when you wanted to introduce a new symbol. That is not a typing issue.

A realistic D/C++ scenario:

import std.stdio;
// imported from libraries:

auto create_name(string n){
        return ["PersonName",n];
}

auto create_name(const(char)* n){
        import core.stdc.string: strlen;
        auto slice = n[0 .. strlen(n)];
        return slice.dup;
}


void main(){
     auto myname = create_name("Ola");
     writeln("Letter count: ", myname.length);
}

Reply via email to