Andrei Alexandrescu wrote:
grauzone wrote:

Maybe I don't get it, but how to you call prepend() from safe code?

module(safe) wyda;

void main() {
    auto lst1 = new List;
    auto lst2 = new List;
    List.prepend(lst1, lst2)
}

This seems to be another case where automatic function rewriting would be nice, a la D's "Functions as Array Properties":

void main() {
    auto lst1 = new List;
    auto lst2 = new List;
    // rewritten by compiler to List.prepend(lst1, lst2):
    lst1.prepend(lst2);
}

Reply via email to