News for hackers. Stuff that matters.
Re:Why Does “=” Mean Assignment? by abakus on Tuesday April 10, 2018 @03:55PM (#16804679)
The length of symbols should roughly be negatively correlated with its frequency.

Since in procedural language, assignment is a much more common operation than equality check, it is reasonable to favor "=" over ":=" or even "<-".

Re:Why Does “=” Mean Assignment? by roselan on Tuesday April 10, 2018 @07:22PM (#16806587)
What does prevent : to become the assignment operator of a language? It's short, and quite "explicit".

x: 2

Re:Why Does “=” Mean Assignment? by mpweiher on Wednesday April 11, 2018 @04:30AM (#16809119)
Self and Newspeak sort of do it this way, adding implicit self to Smalltalk's keyword syntax and accessor convention.

These 'accessors' also work on local variables, there is no special syntax for assignment. So when you write x it means send the message x, which starts its lookup in the local environment and works itself outwards. When you write x:2 it sends the message x: with argument 2, also starting in the local environment.

The accessors are automatically generated in pairs for slots. It sorta works, but it seems a bit too convoluted just to say "hey, we can do everything with just messaging".

Re:Why Does “=” Mean Assignment? by Izkata on Wednesday April 11, 2018 @12:16AM (#16807989)
The Rebol family of languages works like that.
Re:Why Does “=” Mean Assignment? by 9214 on Wednesday April 11, 2018 @02:26AM (#16808539)
Except that it doesn't. ":" in "x:" is not an assignment operator and "x" is not a variable.
Re:Why Does “=” Mean Assignment? by Izkata on Wednesday April 11, 2018 @08:09AM (#16810275)
Yes yes, it's a set-word! type in the "do" dialect. That's not how it's learned when first starting, though, and not usually the thing you're thinking about when using it moment-to-moment.
Re:Why Does “=” Mean Assignment? by bwbw223 on Tuesday April 10, 2018 @09:11PM (#16807232)
Shift key?
Re:Why Does “=” Mean Assignment? by jfoutz on Tuesday April 10, 2018 @04:53PM (#16805273)
also, there's no hand balance on either of the composite symbols. := is my right pinky, <- is different fingers, but bottom and top row. neither exactly flows from the fingertips.
Re:Why Does “=” Mean Assignment? by neaden on Tuesday April 10, 2018 @05:21PM (#16805574)
I don't think that is a big issue. Just bind it to something else. In RStudio by default <- is bound to alt and -.
Re:Why Does “=” Mean Assignment? by abakus on Tuesday April 10, 2018 @05:49PM (#16805839)
But that is still 2 keystrokes. That is why in R they came to the compromise to use both <- and =.
Re:Why Does “=” Mean Assignment? by ryanmonroe on Tuesday April 10, 2018 @06:03PM (#16805955)
Well, it also adds a space before and after so you're saving one keystroke vs space = space
Re:Why Does “=” Mean Assignment? by gowld on Wednesday April 11, 2018 @12:53AM (#16808139)
a byte of RAM or disk is cheaper than a human neuron. Brains are more important than fingers.
Re:Why Does “=” Mean Assignment? by nielsbot on Wednesday April 11, 2018 @01:29AM (#16808309)
Well, I suppose one could add a `⟵` key to the keyboard... :-P
Re:Why Does “=” Mean Assignment? by pbhjpbhj on Tuesday April 10, 2018 @04:45PM (#16805172)
So you have a key with the assignment operator on.