• lad@programming.dev
    ·
    1 year ago

    As far as I remember, the point for not allowing arbitrary expressions is that it makes what looks like formatting an arbitrary complex operation and that it doesn't improve readability that much.

    Although sometimes I miss being able to refer to fields in format, for function calls and especially this many, I agree with an advice to put strings in a vector and joining them. Plus, there is a limit to how many arguments format macro can accept, iirc