Here's a link to the above IRC conversation, which continued after the quoted 
part: https://irclog.perlgeek.de/perl6/2016-11-04#i_13517260

To expand, it's not just Hashes that have this issue; Arrays, SetHash, and 
Complex also do, and probably many others. And the issue is not just about not 
setting default values for attributes when instantiating the object, but use of 
attributes as well.

    <ZoffixW> m: class Foo does Setty { has %.elems;  }
    <camelia> rakudo-moar a581bf: OUTPUT«===SORRY!=== Error while compiling
        <tmp>␤Attribute '%!elems' already exists in the class 'Foo', but a role 
also
        wishes to compose it␤at <tmp>:1␤»

Above, if we imagine %.elems as some new internal attribute we added to Setty, 
you can see it now breaks some user's code.

So I think it would be useful to create some sort of convention where we're 
less likely to impact changes to users' code by making some internal change. 
For attributes, we can prefix the names with 'rak-' or something short and 
consistent to mark them as internal. For the .new() issue with Hashes and 
others, I think lizmat proposed doing something similar to what we do in 
Date/DateTime classes.

Reply via email to