Hacker News new | past | comments | ask | show | jobs | submit login

A simple preprocessor for transforming custom infix operators to method calls might do the trick here. Go comes with good libraries to make this, you wouldn't have to invent a new Go parser. There are other preprocessors that you can look at for inspiration.



That would produce a custom language not understood by other Go users and destroy much of the benefit of the compiler reporting errors straightforwardly.


Sounds very much like the incumbent popular language supporting operator overloading!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: