[RFA] Add method overload resolution to expression parser

Tom Tromey tromey@redhat.com
Wed Oct 14 19:29:00 GMT 2009


>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:

Daniel> Maybe we need to get that merged, then, instead of complicated
Daniel> lifetime-confusing hacks around it :-)

Yeah, this would help in several scenarios.  E.g., it would let us
memoize Python Type objects.

However, in this case, if we made a new type, I think we would still
need a new expression operator.  My reasoning is that we are selecting
an overload at expression evaluation time, so we are using the type in a
fundamentally different way from a cast operator.

I don't think I understand why we do this overload selection at
evaluation time and not during the parse.  (It is often preferable to
defer operations until evaluation time so that we can apply them to a
convenience variable's possibly-mutable type -- but that does not apply
in this instance.)

Tom



More information about the Gdb-patches mailing list