tag:blogger.com,1999:blog-19687827.post113612650015302679..comments2006-11-25T07:31:07.679-07:00Comments on Rhamphoryncus's Brain Dump: User-defined OperatorsAdam Olsenhttp://www.blogger.com/profile/12472103461437043685noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-19687827.post-1153664769938364702006-07-23T08:26:00.000-06:002006-07-23T08:26:00.000-06:00First a side issue, when did you post this comment...First a side issue, when did you post this comment? Probably a while ago and I somehow missed it. Unfortunately blogger doesn't think it's important to provide a date (let alone in a ISO 8601 format!)<BR/><BR/>Yes, my idea would be pretty different. This is necessary to provide arbitrary operator names. Your approach would not provide custom operators at all; instead it would turn various math operators into standard builtin operators and allow them to be overriden.<BR/><BR/>That said, I think yours is a more reasonable approach. Far simpler all around.Adam Olsenhttps://www.blogger.com/profile/12472103461437043685noreply@blogger.comtag:blogger.com,1999:blog-19687827.post-1137536947894242302006-01-17T15:29:00.000-07:002006-01-17T15:29:00.000-07:00This seems too different from how you overload + a...This seems too different from how you overload + and -. I think they should just do this:<BR/><BR/><B>x·y == x.__middle_dot__(y)</B><BR/><BR/>All the Unicode math symbols have <A HREF="http://www.unicode.org/charts/PDF/U2200.pdf" REL="nofollow">official names</A>. And who wouldn't get a kick out of seeing "<B>def __gt__(self, other)</B>" followed by "<B>def __much_greater_than__</B>" and finally "<B>def __very_much_greater_than__</B>"?<BR/><BR/>If Unicode identifiers are added to Python--and I think they will be, eventually--presumably they still won't allow math symbols. There is a <A HREF="http://www.unicode.org/reports/tr31/" REL="nofollow">standard</A>. <BR/><BR/>Anyway, the most important precondition is an easy way to type those symbols.jtohttps://www.blogger.com/profile/03968844388108605008noreply@blogger.com