Issue #8361 has been updated by alexeymuranov (Alexey Muranov).


=begin
Nobu: i do not think the conflict with ternary expression is the worst part: i think that if in ambiguous cases the colon is interpreted as a part of ternary expression, there would be no conflict with existing code.

It was probably the choice of words (({each})) and (({do})) that bothered me.  (({each})) sounds more like a name of a quantifier that should be followed by parameter names, than like a name of a method.

After all, in method definitions the list of parameters is not separated from the body either:

  def foo(x) x*x end

  proc do |x| x*x end
=end

----------------------------------------
Feature #8361: Alternative syntax for block parameter
https://bugs.ruby-lang.org/issues/8361#change-39120

Author: alexeymuranov (Alexey Muranov)
Status: Feedback
Priority: Normal
Assignee: 
Category: syntax
Target version: 


=begin
I propose an alternative syntax for block parameters:

  p = lambda [x] {
    # do whatever you like with x here, but be sure to return the result
  }

instead of

  p = lambda { |x|
    # ...
  }

This would be consistent with the syntax of procedure call: (({p[a]})).

Also, compare:

  a_bunch.each [element] do
    # ...
  end

with:

  a_bunch.each do |element|
    # ...
  end

=end



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