[#66126] Creation/Conversion methods/functions table for Ruby types — SASADA Koichi <ko1@...>
Hi,
5 messages
2014/11/07
[#66248] [ruby-trunk - Feature #10423] [PATCH] opt_str_lit*: avoid literal string allocations — normalperson@...
Issue #10423 has been updated by Eric Wong.
3 messages
2014/11/13
[#66595] [ruby-trunk - Bug #10557] [Open] Block not given when the argument is a string — bartosz@...
Issue #10557 has been reported by Bartosz Kopinski.
3 messages
2014/11/30
[ruby-core:66106] [ruby-trunk - Feature #10318] [PATCH 0/n] Let underscore be positionally matched arg to omit binding obvious variable.
From:
mail@...
Date:
2014-11-05 21:29:30 UTC
List:
ruby-core #66106
Issue #10318 has been updated by gogo tanaka.
oops... I found totally [incompatible code in Rails](https://github.com/rails/rails/blob/cd2d3664e3b434d15b6c19e652befb386187642f/activesupport/lib/active_support/core_ext/object/try.rb#L71) project.
I gave up this approach, nonetheless I still introduce concept omitting obvious variable. (Like Scala's lambda calculus)
[#10394](https://bugs.ruby-lang.org/issues/10394) does make sense so far?
----------------------------------------
Feature #10318: [PATCH 0/n] Let underscore be positionally matched arg to omit binding obvious variable.
https://bugs.ruby-lang.org/issues/10318#change-49818
* Author: gogo tanaka
* Status: Open
* Priority: Normal
* Assignee:
* Category:
* Target version: Next Major
----------------------------------------
I’m so sorry for just proposing this future without PATCH right now ...
(I suppose it contains too much issues.)
After some discussions, let me implement this future.
Of course I need to obtain your consent.
Anyway, I want to let underscore be positionally matched arg and omit to binding obvious variable when it comes to proc, lambda and block .
```
# let items be a Array of String. (e.g. items = ['foo', 'bar', 'foobar']
# Before
items.select { |item| item.include?('foo') }
# After
items.select { _.include?('foo') }
```
Even if block has more than 2 args, I want to omit one of them.
(I know it has much pain ... just idea)
```
# let nums be a Array of Integer. (e.g. nums = [1, 2, 3, 4]
# Before
nums.inject { |sum, num| sum + num }
# After
nums.inject { |sum| sum + _ }
#↑ It seems to difficult to hundle .. but looks aesthetic or understandable.
```
Let me know how do you think about it or what problem is.
thank you. gogo.
---Files--------------------------------
convert_tabs_to_spaces.patch (29.3 KB)
--
https://bugs.ruby-lang.org/