[#79440] [Ruby trunk Bug#13188] Reinitialize Ruby VM. — shyouhei@...
SXNzdWUgIzEzMTg4IGhhcyBiZWVuIHVwZGF0ZWQgYnkgU2h5b3VoZWkgVXJhYmUuCgoKTWFydGlu
6 messages
2017/02/06
[#79441] Re: [Ruby trunk Bug#13188] Reinitialize Ruby VM.
— SASADA Koichi <ko1@...>
2017/02/06
On 2017/02/06 10:10, shyouhei@ruby-lang.org wrote:
[#79532] Immutable Strings vs Symbols — Daniel Ferreira <subtileos@...>
Hi,
15 messages
2017/02/15
[#79541] Re: Immutable Strings vs Symbols
— Rodrigo Rosenfeld Rosas <rr.rosas@...>
2017/02/15
Em 15-02-2017 05:05, Daniel Ferreira escreveu:
[#79543] Re: Immutable Strings vs Symbols
— Daniel Ferreira <subtileos@...>
2017/02/16
Hi Rodrigo,
[#79560] Re: Immutable Strings vs Symbols
— Rodrigo Rosenfeld Rosas <rr.rosas@...>
2017/02/16
Em 15-02-2017 22:39, Daniel Ferreira escreveu:
[ruby-core:79453] [Ruby trunk Feature#12760] Optional block argument for `itself`
From:
non.dmitriy@...
Date:
2017-02-06 08:54:01 UTC
List:
ruby-core #79453
Issue #12760 has been updated by Dmitriy Non.
Hello.
Is there any movement?
----------------------------------------
Feature #12760: Optional block argument for `itself`
https://bugs.ruby-lang.org/issues/12760#change-62885
* Author: Victor Shepelev
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
That's an another attempt to choose good metaphor for `object.(yield self)` (previously: #6721 and ton of duplicates).
In discussion here: https://bugs.ruby-lang.org/issues/11717#note-3 it was said:
> Clearly this is something the Ruby community wants. Just as clearly, it's something nobody can name.
But suddenly... I've thought about this!
```ruby
some.long.method.chain.constructing.string
.itself { |s| "(" + s + ")" }
.itself(&method(:puts))
# or
require 'open-uri'
construct_url(*params)
.itself(&method(:open))
.read
.itself(&JSON.method(:parse))
.to_yaml
.itself(&File.method(:write))
# NB: I understand that _last_ `itself` in both examples
# could as well be `tap`. But not all the previous.
```
Pros:
* method is already here, it has pretty name and underused (almost nothing except `group_by(&:itself)` comes to mind);
* it is not 100% good English, but readable: `itself(&JSON.method(:parse))` = "parse itself with json";
* implementation is trivial, no backwards-compatibility issues (like new methods shadowing something important in third-party library) are expected.
Cons:
* ???
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>