Re:Ruby adds experimental support for rightward assignments
by qbonnard on Thursday September 10, 2020 @02:40PM
(#24435265)
A math tutor of mine was actually pretty angry at computer science for writing things like `a=1; a=2; //so 1=2 ?`
I guess he'd rather have the "assign 42 to age"... Except he'd probably read `42 => age` as "42 implies age", which would probably cause him more sleepless nights ;)
[ Parent
| on HN ]
Re:Ruby adds experimental support for rightward assignments
by toxik on Thursday September 10, 2020 @02:50PM
(#24435347)
He’d probably like a := 42 which is in a lot of languages actually! Also Erlang and other fp’s do consider = equivalence.
Re:Ruby adds experimental support for rightward assignments
by Izkata on Thursday September 10, 2020 @04:36PM
(#24436329)
I noticed a year or two ago when I'm pseudocoding I seem to default to "age <- 42" which I kinda like more...
Re:Ruby adds experimental support for rightward assignments
by __ryan__ on Thursday September 10, 2020 @10:05PM
(#24438478)
I had the same issue. This is why I always comment my assignments.
x = x + 1 // assign x to x+1
Re:Ruby adds experimental support for rightward assignments
by xthestreams on Friday September 11, 2020 @06:38AM
(#24441184)
I can't tell if this is a multiple joke or not
Re:Ruby adds experimental support for rightward assignments
by danellis on Thursday September 10, 2020 @03:16PM
(#24435577)
> math tutor ... angry
It's not the same language, so why should he expect the semantics to be the same?
Re:Ruby adds experimental support for rightward assignments
by JadeNB on Thursday September 10, 2020 @09:09PM
(#24438197)
> It's not the same language, so why should he expect the semantics to be the same?
It's a bit like discovering that inline C in your favourite non-C language isn't actually semantically correct C. If you're a mathematician, then you know, intimately and fluently, how math is spoken and written, so seeing something that looks exactly like "inline math", but isn't, is jarring.
(I don't get angry over it, but it is exactly counter to the extremely delicate and precise way mathematicians train ourselves to think about '='.)