Re: [go-nuts] Missing binary operator shortcuts &&= and ||=

2017-05-05 Thread occitan
Le jeudi 4 mai 2017 22:44:58 UTC+2, Ian Lance Taylor a écrit : > > I assert without evidence that for many people it would be confusing > to see a function call alone on the right hand side of an `=` when > that function may or may not be called. > Various languages like Perl, PHP, Ruby & zsh

Re: [go-nuts] Missing binary operator shortcuts &&= and ||=

2017-05-04 Thread occitan
Le jeudi 4 mai 2017 21:43:19 UTC+2, Ian Lance Taylor a écrit : > > ... it is potentially confusing > to see `a &&= f()` when f() may or may not be called. > How is that more confusing than `a && f()` when f() may or may not be called? Da -- You received this message because you are

[go-nuts] Missing binary operator shortcuts &&= and ||=

2017-05-04 Thread occitan
One apparently random omission in C, which was fixed in Perl, is &&= and ||=: a &&= b a = a && b a ||= b a = a || b except that a gets evalutated only once (e.g. myarray[f(2)] &&= b) Besides being useful, this would make Go more consistent. Of course relative operators also do not