It there a way to change how writeln converts structs to strings? I read in the documentation it uses to!string to convert the struct. Is there a way to overload to!string for my own type?

Let say I have:

struct Point {
    int x, y;
}

and I want writeln(Point(3, 4)); to print "[3, 4]" instead of "Point(3, 4)".

Reply via email to