[#88925] [Ruby trunk Feature#15095] [PATCH] share VM stack between threads and fibers if identical — ko1@...
Issue #15095 has been updated by ko1 (Koichi Sasada).
4 messages
2018/09/09
[#88927] Re: [Ruby trunk Feature#15095] [PATCH] share VM stack between threads and fibers if identical
— Eric Wong <normalperson@...>
2018/09/09
ko1@atdot.net wrote:
[#88926] [Ruby trunk Feature#15095] [PATCH] share VM stack between threads and fibers if identical — ko1@...
Issue #15095 has been updated by ko1 (Koichi Sasada).
3 messages
2018/09/09
[#89218] [Ruby trunk Bug#15130] open-uri hangs on cygwin — duerst@...
Issue #15130 has been updated by duerst (Martin D端rst).
5 messages
2018/09/30
[ruby-core:88969] [Ruby trunk Feature#4475] default variable name for parameter
From:
niinikazuki@...
Date:
2018-09-13 05:44:43 UTC
List:
ruby-core #88969
Issue #4475 has been updated by long_long_float (和生 新美).
I have one idea. We can use `\it` (backslash-it) or `\1` instead of `it`. `\1` means the first argument and `\n` refers `n`th argument.
`\`-something is not used, but `\` means line continuation.
----------------------------------------
Feature #4475: default variable name for parameter
https://bugs.ruby-lang.org/issues/4475#change-74000
* Author: jordi (jordi polo)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version:
----------------------------------------
=begin
There is a very common pattern in Ruby:
object.method do |variable_name|
variable_name doing something
end
Many times in fact the name of the object is so self explanatory that we don't care about the name of the variable of the block. It is common to see things like :
@my_sons.each { |s| s.sell_to_someone }
or
Account.all.each { |a| my_account << a.money }
People tend to choose s or a because we have the class or the object name just there to remind you about the context.
I would like to know if can be a good idea to have a default name for that parameter. I think it is Groovy that does something like:
Account.all.each { my_account << it.money }
Where it is automagically filled and it doesn't need to be declared.
I think it is as readable or more (for newbies who don't know what is ||) and we save some typing :)
=end
--
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>