From: duerst@... Date: 2016-11-14T04:39:10+00:00 Subject: [ruby-core:78114] [Ruby trunk Bug#12929] ternary should look ahead w/in a block (and not care about newlines) Issue #12929 has been updated by Martin D��rst. In Ruby, all operators have to be written at the end of the line to make it possible to distinguish between complete statements (with a missing semicolon) and continuations. The only exception is the '.' operator, which is allowed to be on the next line to make method chaining look better, as follows: ``` array.map ... .select ... .reject ... .group ... .sort ... ``` What do you think is special about the ternary operator? ---------------------------------------- Bug #12929: ternary should look ahead w/in a block (and not care about newlines) https://bugs.ruby-lang.org/issues/12929#change-61479 * Author: shawn wilson * Status: Open * Priority: Normal * Assignee: * ruby -v: * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- foo = (bar ? 0 : 1) # works foo = (bar ? 0 : 1) # works foo = (bar ? 0 : 1) # doesn't work -- https://bugs.ruby-lang.org/ Unsubscribe: