Feature #7907

Give meaning to staby word

Added by Thomas Sawyer about 1 year ago. Updated about 1 year ago.

[ruby-core:52630]
Status:Rejected
Priority:Normal
Assignee:Yukihiro Matsumoto
Category:core
Target version:Next Major

Description

=begin
I noticed that ->word doesn't mean anything. i.e.

->foo
SyntaxError: (irb):4: syntax error, unexpected '\n', expecting keyworddoLAMBDA or tLAMBEG
from /opt/Ruby/1.9.3-p327/bin/irb:12:in `'

If that is always so, then could it be given a meaning as a shorthand for method()? i.e.

->foo

would be the same as writing

method(:foo).to_proc

=end


Related issues

Duplicates ruby-trunk - Feature #7906: Giving meaning to ->foo Rejected 02/22/2013

History

#1 Updated by Koichi Sasada about 1 year ago

  • Description updated (diff)
  • Assignee set to Yukihiro Matsumoto

#2 Updated by Yukihiro Matsumoto about 1 year ago

  • Status changed from Open to Rejected

=begin
I think filling the syntax hole eagerly is a bad idea.

Besides that, I don't think making ((%->foo%)) as method(:foo).to_proc seems a good idea,
since foo in ((%->foo{}%)) is a argument name, not a method name.

Matz.
=end

#3 Updated by Thomas Sawyer about 1 year ago

Ah, ->foo{} did not know that the parenthesis could be left out.

Ok, I'll suggest slight modification then, b/c it still would be nice to have a shorter notation (not just to fill a syntax hole). Could it be a symbol, i.e. ->:foo.

#4 Updated by Thomas Sawyer about 1 year ago

Once a issue has been rejected, is it necessary to open a new case for a modified form of the proposal? In other words is any one going to see the change if it has already been rejected? As with this case?

#5 Updated by Rodrigo Rosenfeld Rosas about 1 year ago

People will see the changes but when they're looking for open issues to decide what to do about them they won't touch closed issues :)

Also available in: Atom PDF