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

    x = 0
    y = 1
    x+y = 0
    z = x+y
What is z?



x+y = 0 (with that specific syntax) will error in pretty much every language.


So we will refuse to allow symbols in identifiers after all?


The only programming languages where arithmetic symbols are allowed identifiers have an identifier sigil (ala Perl, PHP), require whitespace around arithmetic (some teaching languages), or don't have conventional arithmetic syntax (e.g. Forth, Lisp).


Please read the comment I originally answered to.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: