Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It can also be:

x <- x + 1

x := x + 1

But I guess since assignment is more frequent than equality checks, most PL designers opt for using equals. I do like R's left arrow assignment operator. If only keyboards had a default arrow character key. It would completely get rid of a class of errors based on forgetting the second equals sign.



A sane compiler always give a warning when doing a comparison outside a condition and when doing an assignment within a condition.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: