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

> It is sometimes possible to use = for assignment, though I don't understand when this is and is not allowed.

Little bit of interesting history on this was just a google away: http://blog.revolutionanalytics.com/2008/12/use-equals-or-ar...



I'm not sure that post is 100% correct. Reading it gave me a bad feeling that it missed something I'd read in the past. See here for example ...

http://stackoverflow.com/questions/1741820/assignment-operat...

The = operator is only a "top level" construct, while <- can be used anywhere. Now exactly what those limitations are may be a bit subtle (the OP's point), so I also just use <-.




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

Search: