Project

General

Profile

Misc #14768

Add documentation for || and &&

Added by sos4nt (Stefan Schüßler) 5 months ago. Updated 5 months ago.

Status:
Open
Priority:
Normal
Assignee:
-
[ruby-core:87118]

Description

The Ruby documentation doesn't seem to cover || and &&.

The only references I could find are:

http://ruby-doc.org/core-2.5.1/doc/keywords_rdoc.html

and – Short-circuit Boolean and with lower precedence than &&
or – Short-circuit Boolean and with lower precedence than ||

http://ruby-doc.org/core-2.5.1/doc/syntax/assignment_rdoc.html

There are also ||= and &&=. The former makes an assignment if ...

But there's no documentation for the operators themselves.

History

#1 [ruby-core:87126] Updated by shevegen (Robert A. Heiler) 5 months ago

Adding more documentation/references is always good IMO, so
+1 on the issue. Perhaps even adding a new page called
operators.html (or something like that) may be useful in
the long run.

There is an old SO question:

https://stackoverflow.com/questions/1426826/difference-between-and-and-in-ruby

Having this included in the official ruby docs would be
useful to newcomers, I think.

Also available in: Atom PDF