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

"In Skip the = operator introduces a new variable, but unlike other languages the = operator alone can not modify an existing variable."

Using != to assign a value feels really strange to me. I know some languages use := but in those languages typically it's because = is an equality operator. I'm sure there are some exceptions but != just so universally means "not equal" to me.




But it's not just `!=`, it is `!variable = value`, see [1]. That does not look like "not equal" operator.

[1] http://skiplang.com/docs/lvalues.html


Although !x mean "not x" pretty universally.


Yeah, that's true, but I guess one can distinguish it quite easily when it's on the left side of an assignment.


Objective-S uses |= for one-way dataflow constraints, which you could also call "permanent assignment".

http://objective.st/


It does make sense if you realize that it is also used for fields and that a.!b.c = d is different than a.b.!c = d. The first makes a copy of the object at a.b before assigning a new value to its field c.


I too would prefer := or even =!


or <= which vhdl does (it differentiates between variables and signals so it uses both := and <=)


What's stopped me from using this syntax in the past is that it means LTE in basically any language I can think of. One can certainly design a grammar where it's unambiguous, I have in fact, but it still doesn't look right to me.


R uses <- which is less ambiguous at the cost of no longer having an equals sign in it.


That sounds like a benefit to me, not a cost.


That also means they have to use spaces? Otherwise what is the difference between x <- 1 and x < -1?




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

Search: