On Fri, May 5, 2017 at 12:51 AM, roger peppe <rogpe...@gmail.com> wrote:
> On 4 May 2017 at 20:48, Michael Jones <michael.jo...@gmail.com> wrote:
>> What is *actually* missing is boolean operators for boolean types.
>
> Really? We've got !, &&, ||, != (xor), == (xnor). What's missing?

In a sense we are missing & and |, the non-shortcut versions of && and ||.

Ian

>> On Thu, May 4, 2017 at 12:43 PM, Ian Lance Taylor <i...@golang.org> wrote:
>>>
>>> On Thu, May 4, 2017 at 9:42 AM,  <occi...@esperanto.org> wrote:
>>> >
>>> > 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 have this, but there usually the result
>>> > type
>>> > is different (e.g.  bool = int < int)
>>>
>>> The &&= and ||= operators are omitted in both C and Go because they
>>> are short-cutting operators.  When you write `a = a && b`, then if a
>>> is true, b is not evaluated.  So presumably when you write `a &&= b`
>>> then if a is true b is not evaluated.  But it is potentially confusing
>>> to see `a &&= f()` when f() may or may not be called.
>>>
>>> Ian
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "golang-nuts" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to golang-nuts+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>>
>> --
>> Michael T. Jones
>> michael.jo...@gmail.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to