Issue #15768 has been updated by duerst (Martin D=FCrst).

Status changed from Open to Closed

This is per spec as explained, so I'm closing it.

If you should want to change it, please create a feature request, and expla=
in in detail what the change would do and how it would be backwards compati=
ble.

----------------------------------------
Bug #15768: "and", &&, boolean issue, different ruby versions, confusing
https://bugs.ruby-lang.org/issues/15768#change-77645

* Author: daBee (da Bee)
* Status: Closed
* Priority: Normal
* Assignee: =

* Target version: =

* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin15]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Just caught this:

``` ruby
# version 2.5.1, Mac OS

v1 =3D true and false                                # =3D> IRB: true
p v1			                        		# =3D> app.rb: true, IRB: false
v2 =3D true && false                                 # =3D> IRB: false
p v2					                       # =3D> app.rb: false, IRB: false
puts 1 > -1 && 257 < 256			# =3D> app.rb: false, IRB: false

```

## IRB Mac OS 2.6.2

``` ruby
>> v1 =3D true and false
=3D> false
>> v2 =3D true && false
=3D> false
>> puts v1
true
=3D> nil
>> puts v2
false
=3D> nil
```

I might be missing something, but I think there's an issue here, on both ve=
rsions 2.5.1 and 2.6.2.




-- =

https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=3Dunsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>