Forum: Ruby-core [ruby-trunk - Feature #7906][Open] Giving meaning to ->foo

Posted by Thomas Sawyer (7rans)
on 2013-02-21 19:05
(Received via mailing list)
Issue #7906 has been reported by trans (Thomas Sawyer).

----------------------------------------
Feature #7906: Giving meaning to ->foo
https://bugs.ruby-lang.org/issues/7906

Author: trans (Thomas Sawyer)
Status: Open
Priority: Normal
Assignee:
Category: core
Target version: 2.1.0


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

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

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
Posted by Thomas Sawyer (7rans)
on 2013-02-21 19:10
(Received via mailing list)
Issue #7906 has been updated by trans (Thomas Sawyer).


Please fix. Sigh.
----------------------------------------
Feature #7906: Giving meaning to ->foo
https://bugs.ruby-lang.org/issues/7906#change-36716

Author: trans (Thomas Sawyer)
Status: Open
Priority: Normal
Assignee:
Category: core
Target version: 2.1.0


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

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

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
Posted by ko1 (Koichi Sasada) (Guest)
on 2013-02-22 00:31
(Received via mailing list)
Issue #7906 has been updated by ko1 (Koichi Sasada).

Description updated
Assignee set to matz (Yukihiro Matsumoto)


----------------------------------------
Feature #7906: Giving meaning to ->foo
https://bugs.ruby-lang.org/issues/7906#change-36723

Author: trans (Thomas Sawyer)
Status: Open
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: 2.1.0


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

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

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
Posted by Nobuyoshi Nakada (nobu)
on 2013-02-22 03:48
(Received via mailing list)
Issue #7906 has been updated by nobu (Nobuyoshi Nakada).

Description updated

It doesn't seem a good idea to me, because "foo" has different meanings, 
parameter and method name.
----------------------------------------
Feature #7906: Giving meaning to ->foo
https://bugs.ruby-lang.org/issues/7906#change-36760

Author: trans (Thomas Sawyer)
Status: Open
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: 2.1.0


=begin
I noticed that "(({->word}))" doesn't mean anything. i.e.

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

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
Posted by matz (Yukihiro Matsumoto) (Guest)
on 2013-02-22 04:22
(Received via mailing list)
Issue #7906 has been updated by matz (Yukihiro Matsumoto).

Status changed from Open to Rejected

See #7907
----------------------------------------
Feature #7906: Giving meaning to ->foo
https://bugs.ruby-lang.org/issues/7906#change-36765

Author: trans (Thomas Sawyer)
Status: Rejected
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: 2.1.0


=begin
I noticed that "(({->word}))" doesn't mean anything. i.e.

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

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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.