[#84867] [Ruby trunk Bug#14357] thread_safe tests suite segfaults — v.ondruch@...

Issue #14357 has been reported by vo.x (Vit Ondruch).

11 messages 2018/01/15

[#84980] [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — hsbt@...

Issue #13618 has been updated by hsbt (Hiroshi SHIBATA).

10 messages 2018/01/23
[#85012] Re: [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — Eric Wong <normalperson@...> 2018/01/23

hsbt@ruby-lang.org wrote:

[ruby-core:85036] [Ruby trunk Feature#4830][Rejected] Provide Default Variables for Array#each and other iterators

From: matz@...
Date: 2018-01-24 08:40:48 UTC
List: ruby-core #85036
Issue #4830 has been updated by matz (Yukihiro Matsumoto).

Status changed from Assigned to Rejected

Rejected. It would cause too much confusion than convenience.

Matz.


----------------------------------------
Feature #4830: Provide Default Variables for Array#each and other iterators
https://bugs.ruby-lang.org/issues/4830#change-69750

* Author: lazaridis.com (Lazaridis Ilias)
* Status: Rejected
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 
----------------------------------------
for arrays: use "item" by default
for hashes: use "key" and "value" by default

names = ["Jane", "Michele", "Isabella"]
names.each { |name| print name, "\n" } 
names.each { print item, "\n" } 

contact = {name:"Jane", phone:"1234567"}
contact.each { |key, value| print key, ": ", value, "\n"}
contact.each { print key, ": ", value, "\n"}

-

The benefits are:

* more compact code (without loosing clarity of the code).
* no repetitions ("names, name, name") in a one-liner with {} block

This extension does not break any existent behaviour.



-- 
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>

In This Thread

Prev Next