"with" should be deprecated with extreme prejudice

Nick Sabalausky a at a.a
Sun May 17 21:44:59 PDT 2009


"BCS" <none at anon.com> wrote in message 
news:a6268ff5f598cba54ecba238c8 at news.digitalmars.com...
>
> void fn(char[] str, S s)
> {
>    with(s)
>    {
>         sscanf(str.ptr, "<%i, %i, %i>", &x, &z, &y); // I'm not adding 
> this to S
>    }
> }
>

You don't really see that as an improvement over this do you?:

void fn(char[] str, S s)
{
    sscanf(str.ptr, "<%i, %i, %i>", &s.x, &s.z, &s.y);
}

If anything, the "with" version looks worse to me, and those three "s." are 
trivial. 





More information about the Digitalmars-d mailing list