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

Things to consider here are:

- operator precedence

- implicit type casting

- how operator+ is defined per each type (e.g: numbers add, strings concatenate)




The interesting thing is that the "obvious correct" behaviour would require the precedence of the + operator to depend on the types of the operands - which is obviously impossible if it's done at the parse stage...




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: