Project

General

Profile

Actions

Feature #4402

closed

Include an "in" operator

Added by rosenfeld (Rodrigo Rosenfeld Rosas) almost 14 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:35260]

Description

=begin
It would be great to support the syntax

return if result in [nil, 'exit', 'quit']

which is a more humanized way to write

return if [nil, 'exit', 'quit'].include? result

The syntax is already support in for-in loops:

for i in ['a', 'b', 'c']; puts i; end
=end


Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Feature #3845: "in" infix operatorRejectedmatz (Yukihiro Matsumoto)09/17/2010Actions
Actions

Also available in: Atom PDF

Like0
Like0