[#79440] [Ruby trunk Bug#13188] Reinitialize Ruby VM. — shyouhei@...
Issue #13188 has been updated by Shyouhei Urabe.
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:79575] [Ruby trunk Feature#13172] Method that yields object to block and returns result
From:
non.dmitriy@...
Date:
2017-02-17 11:56:20 UTC
List:
ruby-core #79575
Issue #13172 has been updated by Dmitriy Non.
File method_pass.patch added
.patch file
----------------------------------------
Feature #13172: Method that yields object to block and returns result
https://bugs.ruby-lang.org/issues/13172#change-63007
* Author: Dmitriy Non
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
Hi everyone!
There's a `#tap` method, that yields reciever to block and returns reciever itself.
I would like to see method, which would return yield's result.
~~~
some_object.some_method.pass { |x| x && another_object.another_method(x) }
~~~
I've seen many code samples that had a some "middle-variables" to store `#some_method` result.
Those variables are useless after few lines of code, so it would be great to create them in a limited scope (block).
P.S. I am very sorry for my english. I hope you understood me:D
P.P.S. I think there should be a better name than `pass` for such method
UPD. I've created a PR to see if `#pass` fits: https://github.com/ruby/ruby/pull/1521
~~~
$ irb
>> Time.now.pass { |t| t.sunday? ? 'Yay!' : ':(' }
==> ":("
~~~
---Files--------------------------------
method_pass.patch (904 Bytes)
--
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>