Project

General

Profile

Activity

From 12/05/2015 to 12/11/2015

12/11/2015

11:53 PM Bug #11808 (Assigned): Different behavior between Enumerable#grep and Array#grep
Regex special global variables are available within the block for `Array#grep`, but are nil within the block for `Enumerable#grep`.
Here is an example that explains it better:
~~~ruby
class Test
include Enumerable
def each
...
BenOlive (Ben Olive)
10:49 PM Feature #11806 (Closed): [PATCH] IO#advise should not raise Errno::ENOSYS
Applied in changeset r53047.
----------
IO#advise should not raise Errno::ENOSYS
As it is just a hint the kernel is free to ignore,
IO#advise already succeeds when posix_fadvise is not
available build time at all. Following that, if p...
Anonymous
10:36 PM Feature #11806 (Assigned): [PATCH] IO#advise should not raise Errno::ENOSYS
OK, agreed. nobu (Nobuyoshi Nakada)
10:29 PM Feature #11806: [PATCH] IO#advise should not raise Errno::ENOSYS
[email protected] wrote:
> Or `rb_sys_fail` should map `ESYS` to `NotImplementedError`?

I don't think that's a good idea. We are already silent on
systems without HAVE_POSIX_FADVISE at build time.

IO#advise is only a hint to m...
normalperson (Eric Wong)
10:13 PM Feature #11806: [PATCH] IO#advise should not raise Errno::ENOSYS
Or `rb_sys_fail` should map `ESYS` to `NotImplementedError`? nobu (Nobuyoshi Nakada)
10:08 PM Feature #11806: [PATCH] IO#advise should not raise Errno::ENOSYS
Not raising `NotImplementedError`? nobu (Nobuyoshi Nakada)
08:05 PM Feature #11806 (Closed): [PATCH] IO#advise should not raise Errno::ENOSYS
As it is just a hint the kernel is free to ignore,
IO#advise already succeeds when posix_fadvise is not
available build time at all. Following that, if posix_fadvise
was available at build time but not implemented in the running
ker...
normalperson (Eric Wong)
10:36 PM Bug #11807 (Third Party's Issue): Build failure of Ruby 2.3.0 preview1 and 2
I got build failure reports for Ruby 2.3.0 preview 1 and 2.
* https://github.com/rbenv/ruby-build/issues/833
* https://github.com/rbenv/ruby-build/issues/848
* https://gist.github.com/kurotaky/726a442fc8812fb2e142
hsbt (Hiroshi SHIBATA)
10:05 PM Bug #10097 (Closed): Case-insensitive Regexp matching for Windows-1252 not working for ŠšŽžŒœÿŸ
Applied in changeset r53046.
----------
enc/windows_1252.c: new
* enc/windows_1252.c: separate from ISO-8859-1 to fix 0x80..0x9e
range. [ruby-core:64049] [Bug #10097]
nobu (Nobuyoshi Nakada)
08:04 AM Bug #10097: Case-insensitive Regexp matching for Windows-1252 not working for ŠšŽžŒœÿŸ
Nobuyoshi Nakada wrote:
> Is this correct?
> ...
Sorry for the very slow response. Please commit. Thanks!
duerst (Martin Dürst)
08:18 PM Feature #11405: [PATCH] hash.c: minor speedups to int/fixnum keys
Yusuke Endoh <[email protected]> wrote:
> > I'm curious, how did you notice this?
>
> In short, I was studying hash conflicts for another reason.
>
> The detailed context is off topic, but you might be interested.

<snip>

>...
normalperson (Eric Wong)
08:18 PM Feature #11405: [PATCH] hash.c: minor speedups to int/fixnum keys
> The cause was a dense cdhash in opt_case_dispatch. Both programs
> ...
Why not decrease rehashing threshold?
1 is very good choice :)
Yeah, it will increase memory consumption a bit.
ok, let it be 2
funny_falcon (Yura Sokolov)
04:48 PM Feature #11405: [PATCH] hash.c: minor speedups to int/fixnum keys
> I'm curious, how did you notice this?

In short, I was studying hash conflicts for another reason.


The detailed context is off topic, but you might be interested.
I encountered an interesting behavior of case statement:

100...
mame (Yusuke Endoh)
08:24 AM Feature #11405 (Closed): [PATCH] hash.c: minor speedups to int/fixnum keys
Applied in changeset r53037.
----------
hash.c (rb_num_hash_start): avoid pathological behavior
The OR-ing itself is bad for a hash function, and shifting 3 bits
left was not enough to undo the damage done by shifting
(RUBY_SPECIAL_SHI...
Anonymous
06:42 PM Feature #9451: Refinements and unary & (to_proc)
Sorry, just saw that [issue 9786](https://bugs.ruby-lang.org/issues/9786) is equivalent to this one and was marked as rejected. Thanks! justcolin (Colin Fulton)
04:03 PM Bug #11804: 52931 以降、caseでInfinityを使用するとFloatDomainErrorが発生する
Thanks for your patch (Eric) :) yui-knk (Kaneko Yuichiro)
01:53 PM Bug #11804: 52931 以降、caseでInfinityを使用するとFloatDomainErrorが発生する
Backported into `ruby_2_2` branch at r53040. nagachika (Tomoyuki Chikanaga)
09:15 AM Bug #11804 (Closed): 52931 以降、caseでInfinityを使用するとFloatDomainErrorが発生する
Applied in changeset r53039.
----------
insns.def (opt_case_dispatch): avoid converting Infinity
Infinity cannot be written as an optimizable literal,
so it can never match a key in a CDHASH.
Avoid converting it to prevent FloatDomainE...
Anonymous
09:05 AM Bug #11804: 52931 以降、caseでInfinityを使用するとFloatDomainErrorが発生する
Not a new bug, actually; just easier to find since r52931
(Sorry I don't know Japanese, but was able to understand the Ruby at least).
This will need to be backported.
~~~
inf = 1.0/0.0
result = case inf
when 1 then 1
...
normalperson (Eric Wong)
08:24 AM Bug #11804 (Closed): 52931 以降、caseでInfinityを使用するとFloatDomainErrorが発生する
以下のようなケースです。
```ruby
def test_infinity
inf = 1.0/0.0
result = case inf
when true then 1
when false then 0
else
inf.to_i rescue nil
end
asser...
yui-knk (Kaneko Yuichiro)
10:24 AM Bug #11805 (Closed): Cannot run Ruby
I installed the new Ruby, and tried to run Ruby, but it raises the following error.
(Since I installed Ruby 2.3.0preview1, it had a bug, and I had not been able to run Ruby, and now, after having waited for a month, I installed the ne...
sawa (Tsuyoshi Sawada)
09:20 AM Feature #5478: Add syntax to import Set into core
It may be a good idea if somebody could provide some actual data/examples for the claim "However, a lot of Ruby developers use arrays for situations where it would be more reasonable to use a set.". E.g. how frequent are sets when compar... duerst (Martin Dürst)
08:28 AM Feature #11788: New ISeq serialize binary format
On 2015/12/11 17:15, Vít Ondruch wrote:
> Dne 8.12.2015 v 11:56 [email protected] napsal(a):
>> The goal of this project is to provide "machine dependent" binary file to achieve:
>
> Could you please elaborate more about this? For exam...
ko1 (Koichi Sasada)
06:20 AM Bug #11803: NoMethodError when calling String#gsub
first i dont think its a good idea in a to_s method to change the value of the object.
otherwise you need to use @instance variables then it works:
~~~ruby
class TestFail
def initialize(word)
@word = word
end
def to_...
Hanmac (Hans Mackowiak)
06:19 AM Bug #11803 (Rejected): NoMethodError when calling String#gsub
~~~ruby
def to_s
return unless word
word = word.gsub(/a/, "")
~~~
You make a new local variable here, and call `gsub` on it before assignment.
nobu (Nobuyoshi Nakada)
12:37 AM Bug #11803 (Rejected): NoMethodError when calling String#gsub
Assigning the result of a call to String#gsub throws a NoMethodError. It seems to have to do with assigning the return value to a variable with the same name as the method returning the string gsub is called on. I've included short scrip... Anonymous

12/10/2015

11:35 PM Feature #11100: Permit multiple captures with String[Regexp, ...]
I support allowing multiple captures. I think the [1,2] syntax is the most intuitive. djberg96 (Daniel Berger)
10:00 PM Feature #11547: remove top-level constant lookup
Hi Shugo. Just as it does now, it doesn't perform any magic (fallback to some other scope) and doesn't emit any warning. How is it related to my bug report/ feature request? Cheers, Corin. gucki1 (Corin Langosch)
07:28 PM Feature #11405: [PATCH] hash.c: minor speedups to int/fixnum keys
[email protected] wrote:
> This caused a lot of trivial hash conflicts of Fixnums that is >= 16384.

Thanks for noticing, I will investigate.

I'm curious, how did you notice this?

I'll probably integrate some well-known hashin...
normalperson (Eric Wong)
10:58 AM Feature #11405: [PATCH] hash.c: minor speedups to int/fixnum keys
i did a little check:
~~~ruby
16384.upto(65535).group_by(&:hash).select {|k,v| v.size == 1} #=> {}
~~~
means from 16384 to 65535 all numbers have duplicated hash values
Edit:
i did scan for more and i found this: four followi...
Hanmac (Hans Mackowiak)
10:34 AM Feature #11405 (Assigned): [PATCH] hash.c: minor speedups to int/fixnum keys
This caused a lot of trivial hash conflicts of Fixnums that is >= 16384.
~~~~
$ ./miniruby -ve 'p 16384.hash; p 16385.hash'
ruby 2.3.0dev (2015-12-10 master 52945) [x86_64-linux]
1104801043349207800
1104801043349207800
~~~~
Ot...
mame (Yusuke Endoh)
07:08 PM Bug #11802 (Rejected): Hash.new and {} have different behaviour
marcandre (Marc-Andre Lafortune)
03:59 PM Bug #11802: Hash.new and {} have different behaviour
`p {}` is parsed as `p() { }`
you see it when you try:
~~~ruby
p { :key => "value"} #which does raise a Syntax Error
~~~
you need `()`
~~~ruby
p({ :key => "value"}) # => {:key=>"value"}
~~~
Hanmac (Hans Mackowiak)
03:39 PM Bug #11802: Hash.new and {} have different behaviour
It looks like a block, but:
irb(main):001:0> {}.class
=> Hash
irb(main):002:0> {}
=> {}
aufi (Marek Aufart)
03:26 PM Bug #11802 (Rejected): Hash.new and {} have different behaviour
It looks that {} is not recognized as a variable sometimes.
irb(main):001:0> p Hash.new
{}
=> {}
irb(main):002:0> p {}
=> nil
Similar in rspec test:
expect(subject.something).to eq {} # fails on not given argument for eq
ex...
aufi (Marek Aufart)
06:57 PM Feature #11801 (Closed): rb_inspect shouldn't raise error even if calling inspect returns non compatible strings
Applied in changeset r53027.
----------
* object.c (rb_inspect): dump inspected result with rb_str_escape()
instead of raising Encoding::CompatibilityError. [Feature #11801]
* string.c (rb_str_escape): added to dump given string like...
naruse (Yui NARUSE)
04:22 AM Feature #11801 (Closed): rb_inspect shouldn't raise error even if calling inspect returns non compatible strings
Current rb_inspect raises Encoding::Compatibility error if obj.inspect returns a string
whose encoding is not compatible with resulted string's encoding.
But the behavior is not useful on inspecting an array or a hash containing such s...
naruse (Yui NARUSE)
06:05 PM Feature #10617: Change multiple assignment in conditional from parse error to warning
Why hasn't this been accepted? There is no good reason that an expression that could be nil should not be testable. bughit (bug hit)
04:26 PM Feature #11578: Add a method to check if a number is probably prime or composite (Patch included)
NagaChaitanya Vellanki wrote:
> Yui NARUSE wrote:
> ...
chaitanyav (NagaChaitanya Vellanki)
04:24 PM Feature #11578: Add a method to check if a number is probably prime or composite (Patch included)
Yui NARUSE wrote:
> Use OpenSSL::BN.
Rehearsal ---------------------------------------------------------------
Probably prime 11.990000 0.060000 12.050000 ( 12.054223)
OpenSSL::BN.prime_fasttest? 0.020000 0.000...
chaitanyav (NagaChaitanya Vellanki)
01:30 AM Feature #11578 (Rejected): Add a method to check if a number is probably prime or composite (Patch included)
Use OpenSSL::BN. naruse (Yui NARUSE)
04:12 PM Bug #11779: Module#using does not make sense as a method
Shugo Maeda wrote:
> bug hit wrote:
> ...
Of course I don't mean in the same exact way, meta-programming is different than native syntax. However the question of "how" does not apply here, because you are arguing that it should be for...
bughit (bug hit)
09:28 AM Bug #11779: Module#using does not make sense as a method
bug hit wrote:
> > > ruby is too dynamic a language to have a clear distinction between what you're calling "static" and "dynamic" You are labeling class bodies as "static" and methods "dynamic" but a class body is executable ruby and ...
shugo (Shugo Maeda)
07:17 AM Bug #11779: Module#using does not make sense as a method
Shugo Maeda wrote:
> bug hit wrote:
> ...
Did you see the example in my previous post? Effectively there is no prohibition against module_eval with #using in methods, because you can open a class in a method and call module_eval from ...
bughit (bug hit)
07:07 AM Bug #11779: Module#using does not make sense as a method
bug hit wrote:
> Shugo Maeda wrote:
> ...
Methods are expected to be invoked more than once, so there's a significant difference from class bodies.
That's why static features like constant assignments are prohibited in method definiti...
shugo (Shugo Maeda)
07:01 AM Bug #11779: Module#using does not make sense as a method
Shugo Maeda wrote:
> ...
> ...
ruby is too dynamic a language to have a clear distinction between what you're calling "static" and "dynamic" You are labeling class bodies as "static" and methods "dynamic" but a class body is executabl...
bughit (bug hit)
03:58 AM Bug #11779: Module#using does not make sense as a method
bug hit wrote:
> so a #using in module_eval is only useful if you want the refinement confined to the block. There might be uses for that, not sure.
Yes, it's the current intended behavior.
> ...
Such dynamic extension of refinem...
shugo (Shugo Maeda)
01:53 PM Feature #5478: Add syntax to import Set into core
Another syntax idea:
```ruby
{|1,2,3|}
```
alexeymuranov (Alexey Muranov)
12:26 PM Feature #11690: Update Hash during multiple assignment
I made a gem for this. [gem assign](https://github.com/danielpclark/assign)
I figure Kernel#assign is the best method name for this and the object it returns is an Assignable object.
danielpclark (Daniel P. Clark)
05:17 AM Bug #11313: Fixed a couple of typos
I applied only 0002-cont.c-it-must-be-not-it-must-be-be.patch. 0001-proc.c-be-a-kind_of-not-be-be-a-kind_of.patch is already fixed another commit. hsbt (Hiroshi SHIBATA)
05:16 AM Bug #11313 (Closed): Fixed a couple of typos
Applied in changeset r53023.
----------
* cont.c: fix a double word typo.
[Bug #11313][ruby-core:69749]
hsbt (Hiroshi SHIBATA)
05:14 AM Bug #11764 (Closed): ext/tk/lib/multi-tk.rb: fix three typos.
Applied in changeset r53022.
----------
* ext/tk/lib/multi-tk.rb: fix typos.
[Bug #11764][ruby-core:71800]
hsbt (Hiroshi SHIBATA)
12:51 AM Bug #11799: Object allocation during garbage collection phase terminates the Ruby process
Koichi Sasada wrote:
> https://github.com/rdp/google_hash/blob/master/ext/template/google_hash.cpp.erb#L170
> ...
**Thanks for the prompt attention and feedback. It's greatly appreciated.**
google_hash will be removed (unfortunatel...
charlez (Charles Leu)
12:36 AM Bug #11799 (Third Party's Issue): Object allocation during garbage collection phase terminates the Ruby process
nobu (Nobuyoshi Nakada)
12:35 AM Bug #11799: Object allocation during garbage collection phase terminates the Ruby process
https://github.com/rdp/google_hash/blob/master/ext/template/google_hash.cpp.erb#L170
I'm not sure the implementation details, but
> for(<%= type %>_hash_map< <%= key_type %>, <%= value_type %> <%= extra_hash_params %> >::iterator ...
ko1 (Koichi Sasada)
12:26 AM Bug #11799: Object allocation during garbage collection phase terminates the Ruby process
Thank you for your log.
This is a reason.
```
(gdb) thread 12
[Switching to thread 12 (Thread 0x7fffe5fc4700 (LWP 27808))]#0 0x00007ffff772463c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
(gdb) bt
#0 0x00...
ko1 (Koichi Sasada)
12:08 AM Bug #11799: Object allocation during garbage collection phase terminates the Ruby process
[email protected] wrote:
> * If this is a problem due to usage of certain gems that aren't 'well-behaved', it would be good to know which ones to avoid.

Fwiw, I took a quick look at the dmark/dfree callbacks registered with
*Da...
normalperson (Eric Wong)
12:33 AM Bug #11800 (Closed): MakeMakefile breaks with frozen strings
Applied in changeset r53020.
----------
disable frozen-string-literal
* lib/mkmf.rb, lib/shellwords.rb: disable frozen-string-literal.
[ruby-core:72011] [Bug #11800]
nobu (Nobuyoshi Nakada)
12:11 AM Bug #11798: MkConfig breaks with frozen strings
`RbConfig.expand` has to modify the argument destructively. nobu (Nobuyoshi Nakada)

12/09/2015

10:48 PM Bug #11800 (Closed): MakeMakefile breaks with frozen strings
It seems MkConfig(RbConfig) breaks frozen strings mode
~~~
/Users/deepj/.rubies/ruby-2.3.0-dev/lib/ruby/2.3.0/mkmf.rb:1292:in `<module:MakeMakefile>': can't modify frozen object (RuntimeError)
from /Users/deepj/.rubies/ruby-2.3.0-d...
deepj (deepj #)
10:15 PM Bug #11799: Object allocation during garbage collection phase terminates the Ruby process
Supplied correct edition of file ruby_bug-gdb.txt charlez (Charles Leu)
10:07 PM Bug #11799 (Third Party's Issue): Object allocation during garbage collection phase terminates the Ruby process
Resurrection of Bug #11549 that was apparently inadvertently deleted.
Also note the similarity to Bug #10868.
**Summary:** Multi-Threaded Ruby apps are often problematic; especially so when utilizing thread pools, and scheduling work...
charlez (Charles Leu)
09:11 PM Bug #11798: MkConfig breaks with frozen strings
Hi Nobu, I offer this alternative patch. What do you think? deepj (deepj #)
08:53 PM Bug #11798 (Closed): MkConfig breaks with frozen strings
Applied in changeset r53017.
----------
mkconfig.rb: must not be frozen
* tool/mkconfig.rb: rbconfig must not be fronzen-string-literal to
expand CONFIG hash. [ruby-core:72006] [Bug #11798]
nobu (Nobuyoshi Nakada)
08:42 PM Bug #11798 (Closed): MkConfig breaks with frozen strings
It seems MkConfig(RbConfig) breaks frozen strings mode
~~~
/Users/deepj/.rubies/ruby-2.3.0-dev/lib/ruby/2.3.0/x86_64-darwin15/rbconfig.rb:249:in `replace': can't modify frozen String, created at /Users/deepj/.rubies/ruby-2.3.0-dev/li...
deepj (deepj #)
08:15 PM Misc #11795 (Closed): [PATCH] get rid of breaking strict alias for XL compiler
gcc/clang optimize away that `memcpy`, at least. nobu (Nobuyoshi Nakada)
02:35 PM Misc #11795: [PATCH] get rid of breaking strict alias for XL compiler
Please cancel this, I see I already submitted the changes in bug 11790. Sorry about that. Zarko (Zarko Todorovski)
02:29 PM Misc #11795 (Closed): [PATCH] get rid of breaking strict alias for XL compiler
Related to bug 11790. Thank you for adding the changeset.
It may be better to add a IBM XL specific instruction for this:
in line 70 of regparse.h
~~~c
#ifdef __ibmxl__
#define SET_NTYPE(node, ntype) {int value = ntype; memcp...
Zarko (Zarko Todorovski)
05:02 PM Feature #11725 (Closed): debugging support for frozen string literal
Applied in changeset r53009.
----------
* compile.c (iseq_compile_each): do not add debug information
without --debug or --debug=frozen-string-literal option
because String#dup slows down with debug information.
[Feature #11725]
...
ko1 (Koichi Sasada)
04:32 PM Feature #11725 (Assigned): debugging support for frozen string literal
We found performance regression with this feature.
"foo".dup with frozen literal also copy location information.
Quoted from https://bugs.ruby-lang.org/issues/11782#change-55313
```
# frozen-string-literal: true
user ...
ko1 (Koichi Sasada)
04:37 PM Bug #11779: Module#using does not make sense as a method
Shugo Maeda wrote:
> bug hit wrote:
> ...
Perhaps, since you can apply the refinement outside the module_eval block which will also affect the block:
```ruby
module Refinement
refine String do
def refined?
true
...
bughit (bug hit)
06:24 AM Bug #11779: Module#using does not make sense as a method
bug hit wrote:
> > Nobu didn't explain that Module#using should work in methods.
> ...
Because refinement activation should be as static as possible.
It might be better to prohibit Module#using in module_eval.
shugo (Shugo Maeda)
05:40 AM Bug #11779: Module#using does not make sense as a method
Shugo Maeda wrote:
> bug hit wrote:
> ...
Note that when #using is called in a module_eval block, its effect is confined to the body of the block. So why should it matter if module_eval is called from a method or top level or from ano...
bughit (bug hit)
05:29 AM Bug #11779: Module#using does not make sense as a method
bug hit wrote:
> Shugo Maeda wrote:
> ...
Nobu didn't explain that Module#using should work in methods.
Module#using is designed not for such dynamic use.
shugo (Shugo Maeda)
05:17 AM Bug #11779: Module#using does not make sense as a method
Shugo Maeda wrote:
> bug hit wrote:
> ...
This wasn't really my expectation, it was nobu's explanation (It is not a noop, just you don't use the refined method there), which I confirmed.
"using" called from a module_eval block activ...
bughit (bug hit)
05:02 AM Bug #11779: Module#using does not make sense as a method
bug hit wrote:
> so if `using` inside module_eval is intended to work, then invoking such a module_eval from a method should also work (it raises Module#using is not permitted in methods):
Module#using is not intented to work as you ...
shugo (Shugo Maeda)
02:00 AM Bug #11779: Module#using does not make sense as a method
bug hit wrote:
> bug hit wrote:
> ...
so if `using` inside module_eval is intended to work, then invoking such a module_eval from a method should also work (it raises Module#using is not permitted in methods):
```Ruby
module Refine...
bughit (bug hit)
01:55 AM Bug #11779: Module#using does not make sense as a method
bug hit wrote:
> Nobuyoshi Nakada wrote:
> ...
ok got it, thanks
```ruby
module Refinement
refine String do
def refined?
true
end
end
end
module Foo
def self.refined?
''.refined? rescue false
e...
bughit (bug hit)
01:51 AM Bug #11779: Module#using does not make sense as a method
Nobuyoshi Nakada wrote:
> It is not a noop, just you don't use the refined method there.
Where "there"? Where should I use the refined method to see the effect of that using call?
bughit (bug hit)
01:41 AM Bug #11779: Module#using does not make sense as a method
It is not a noop, just you don't use the refined method there. nobu (Nobuyoshi Nakada)
01:31 AM Bug #11779: Module#using does not make sense as a method
Please explain the following behavior of `using`:
```ruby
module Refinement
refine String do
def refined?
true
end
end
end
module Foo
def self.refined?
''.refined? rescue false
end
end
Foo.mo...
bughit (bug hit)
01:17 AM Bug #11779: Module#using does not make sense as a method
Yukihiro Matsumoto wrote:
> Providing a feature by a method does not imply dynamic scoping, for example, Module#private etc. work in lexical scope.
However, it might be better to provide Kernel#using instead of main.using and Module#...
shugo (Shugo Maeda)
04:17 PM Feature #11797: `Enumerator#with_object` with multiple objects
The StackOverflow question link was wrong. It should be: http://stackoverflow.com/questions/34181231. sawa (Tsuyoshi Sawada)
04:15 PM Feature #11797 (Closed): `Enumerator#with_object` with multiple objects
Sometimes, when working with `Enumerator#with_object`, I want to keep some additional temporary objects besides the one to return. A use case is as follows (I got this from this StackOverflow question: http://stackoverflow.com/questions/... sawa (Tsuyoshi Sawada)
03:26 PM Bug #11792: Backport r52199 (pthread_getattr_np is broken on AIX)
Backported into `ruby_2_2` branch at r53007. nagachika (Tomoyuki Chikanaga)
03:21 PM Bug #11794: backport r51808
Backported into `ruby_2_2` branch at r53006. nagachika (Tomoyuki Chikanaga)
06:17 AM Bug #11794 (Closed): backport r51808
毎回mswinのCIでエラーなので。 usa (Usaku NAKAMURA)
02:33 PM Feature #11796 (Open): [PATCH] Refactor reduce call get_stat()
I fix to reduce call get_stat() as much as possible.
But sorry, I don't have every environment for testing.
ksss (Yuki Kurihara)
12:46 PM Feature #11781: Would it be possible to alias .prepend() towards .unshift() for class Array by default?
I too would expect `Array#prepend` to be the opposite of `Array#concat`, taking `other_ary` as a parameter, because that seems to more closely match the relationship between `String#prepend` and `String#concat`.
It sounds potentially ...
matthewd (Matthew Draper)
12:34 PM Feature #11781: Would it be possible to alias .prepend() towards .unshift() for class Array by default?
`String#prepend` and `String#concat` are a pair that work similarly (with just the difference on where the new substring is inserted). And since there is already `Array#concat`, introducing `Array#prepend` would suggest that they should ... sawa (Tsuyoshi Sawada)
07:51 AM Feature #11781: Would it be possible to alias .prepend() towards .unshift() for class Array by default?
Their arities differ.
Let `String#prepend` take any number of arguments?
~~~diff
diff --git i/array.c w/array.c
index dd14837..b98142d 100644
--- i/array.c
+++ w/array.c
@@ -5832,6 +5832,7 @@ Init_Array(void)
rb_define_met...
nobu (Nobuyoshi Nakada)
07:28 AM Feature #11781: Would it be possible to alias .prepend() towards .unshift() for class Array by default?
I prefer we avoid introducing needless aliases.

It increases human cognitive overhead for reviewing/auditing
code and also wastes machine memory + CPU cycles at startup.
normalperson (Eric Wong)
03:56 AM Feature #11781: Would it be possible to alias .prepend() towards .unshift() for class Array by default?
It sounds nice. Since it is right before 2.3 release, it may be too late for it.
Matz.
matz (Yukihiro Matsumoto)
12:29 PM Bug #11764: ext/tk/lib/multi-tk.rb: fix three typos.
Maybe you should set to another guy, because the last connection of Hidetoshi Nagai is 07/19/2015.
https://bugs.ruby-lang.org/users/122
red54 (XIE Zhibang)
11:12 AM Misc #11789 (Closed): [PATCH] Refactor File::Stat#world_readable? and #world_writable?
usa (Usaku NAKAMURA)
10:57 AM Misc #11789: [PATCH] Refactor File::Stat#world_readable? and #world_writable?
This patch was aleady applied.
Close?
ksss (Yuki Kurihara)
09:58 AM Feature #11786: [PATCH] micro-optimize case dispatch even harder
On 2015/12/09 18:25, Eric Wong wrote:
>> > (Sorry if I overlooked marking)
> Wait, putobject calls (and TS_VALUE operands) do not go away when
> opt_case_dispatch insn is emitted, so marking keys in literal hash is
> redundant. sinc...
ko1 (Koichi Sasada)
09:28 AM Feature #11786: [PATCH] micro-optimize case dispatch even harder
SASADA Koichi <[email protected]> wrote:
> On 2015/12/08 13:53, Eric Wong wrote:
> >> > how to mark literal objects?
> > Take ideas from nobu (r52708 :)
>
> I meant marking, not for freeing a table.
>
> For example, bignum objects ...
normalperson (Eric Wong)
08:02 AM Bug #11790 (Closed): [PATCH] ANSI alias rules fix
Applied in changeset r52999.
----------
regparse.h: ANSI alias rule fix
* regparse.h (SET_NTYPE): get rid of breaking strict aliasing.
patch by Zarko Todorovski in [ruby-core:71953]. [Bug #11790]
nobu (Nobuyoshi Nakada)
07:16 AM Bug #11754 (Closed): Visibility scope is kept after lexical scope is closed
Applied in changeset r52996.
----------
* vm.c (rb_vm_cref_in_context): Module#define_method in non-class
expression should be public.
[Bug #11754]
* test/ruby/test_method.rb: add a test.
ko1 (Koichi Sasada)
06:31 AM Bug #11793: puts 'ab'.gsub('a', '\\+') - unexpected output
The document states "It may contain back-references", `\+` is one of them.
Note: preformated text requires a preceding blank line.
nobu (Nobuyoshi Nakada)
06:26 AM Bug #11793: puts 'ab'.gsub('a', '\\+') - unexpected output
I should have used this example:
~~~
puts 'ab'.gsub('a', "\x5C\x5C\x2B")
\+b
~~~
phluid61 (Matthew Kerwin)
06:23 AM Bug #11793: puts 'ab'.gsub('a', '\\+') - unexpected output
Substitution parameters work in string-string mode:
~~~
irb> puts 'ab'.gsub('a', %q(\`))
b
irb> puts 'ab'.gsub('a', %q(\&))
ab
irb> puts 'ab'.gsub('a', %q(\'))
bb
irb> puts 'ab'.gsub('a', %q(\0))
ab
irb> puts 'ab'.gsub('a', %...
phluid61 (Matthew Kerwin)
06:18 AM Bug #11793 (Rejected): puts 'ab'.gsub('a', '\\+') - unexpected output
usa (Usaku NAKAMURA)
06:16 AM Bug #11793: puts 'ab'.gsub('a', '\\+') - unexpected output
its because how `gsub` works you need to escape the `\`
~~~ruby
puts 'ab'.gsub('a', '\\\+') #=> \+b
~~~
Hanmac (Hans Mackowiak)
05:31 AM Bug #11793 (Rejected): puts 'ab'.gsub('a', '\\+') - unexpected output
Test case:
~~~ruby
puts 'ab'.gsub('a', '\\+')
~~~
Expected output:
~~~
\+b
~~~
Actual output:
~~~
b
~~~
The way I understand `gsub(pattern, replacement)` when used with two string arguments is that it will perform...
burnson (William Burnson)
05:49 AM Bug #11763 (Closed): gc.c: fix two typos.
Applied in changeset r52994.
----------
* gc.c (gc_mark_stacked_objects): fix typo.
reported by XIE Zhibang. [Bug #11763]
ko1 (Koichi Sasada)
05:14 AM Feature #11788: New ISeq serialize binary format
Koichi Sasada wrote:
> Updated.
Thanks.
> ...
I'm not sure, too.
But I can say that if a feature introduces a known security risk, users must be informed with documentations.
usa (Usaku NAKAMURA)
05:08 AM Feature #11788: New ISeq serialize binary format
On 2015/12/09 13:41, [email protected] wrote:
> You should mention it at NEWS.

Updated.
I'm not sure how detail description is needed on an entry.

--
// SASADA Koichi at atdot dot net
ko1 (Koichi Sasada)
04:41 AM Feature #11788: New ISeq serialize binary format
Koichi Sasada wrote:
> Note that current implementation lacks error checking and verification,
> ...
(snip)
> It will be a security risk if malicious person can pass modified binary data to MRI.
You should mention it at NEWS.
usa (Usaku NAKAMURA)
12:53 AM Feature #11788 (Assigned): New ISeq serialize binary format
Note that current implementation lacks error checking and verification,
so that broken binary data cause SEGV (or access overflow) easily.
This is another reason why I wrote it is not for "migration" purpose.
(malicious binary data...
ko1 (Koichi Sasada)
12:45 AM Feature #11791 (Feedback): The literal quotes should accept more quote characters (aka more unicode characters)
You didn't explain why we should extend. Extending quote characters can cause confusion.
We cannot accept it without concrete use-case or benefit description.
Matz.
matz (Yukihiro Matsumoto)

12/08/2015

11:48 PM Bug #11792 (Closed): Backport r52199 (pthread_getattr_np is broken on AIX)
This is a ticket to manage back-porting r52199 to 2.1 and 2.2. ReiOdaira (Rei Odaira)
11:24 PM Bug #11790: [PATCH] ANSI alias rules fix
Does CAS work?
~~~c
/* THREAD_ATOMIC_START; */
{
FreeNode *n = FreeNodeList, *n0;
while (IS_NOT_NULL(n) && (n0 = ATOMIC_PTR_CAS(FreeNodeList, n, n->next)) != n)
n = n0;
if (IS_NOT_NULL(n)) return (Node* )n;...
nobu (Nobuyoshi Nakada)
04:32 PM Bug #11790 (Closed): [PATCH] ANSI alias rules fix
line 70 in file regparse.h:
~~~c
#define SET_NTYPE(node, ntype) (node)->u.base.type = (ntype)
~~~
needs to be changed to conform with ANSI alias rules
Line 70 as it is can lead to errors in compiling in regparse.c
~~~c
...
Zarko (Zarko Todorovski)
09:55 PM Feature #11791 (Feedback): The literal quotes should accept more quote characters (aka more unicode characters)
I frequently use literal quoting, aka %q[], %w[], %i[]
I'd like to suggest that the set of quoting characters should be extended.
I believe that some pairs of unicode character should also be allowed as paired quoting characters.
...
eike.rb (Eike Dierks)
09:38 PM Bug #11759: URI breaks with frozen strings
[email protected] wrote:
> > I prefer String.new() to "".dup because the former describes intention (of creating a buffer).
>
> Ok. I've attached a rev3 patch that uses `String.new` instead of `''.dup`.

Thanks. Committed as ...
normalperson (Eric Wong)
09:30 PM Bug #11759 (Closed): URI breaks with frozen strings
Applied in changeset r52981.
----------
lib/uri/generic.rb: enable frozen_string_literal
* lib/uri/generic.rb: enable frozen_string_literal
(split_userinfo): remove explicit .freeze for string literals
(check_path): ditto
(query)...
Anonymous
05:38 PM Feature #11782: String#+@ and String#-@
how about splitting strings like this?
~~~
long_string = 'first part ' +
'second part ' +
'last part'
~~~
Should long_string be optimized by the compiler to generate 'first part second part last part' as a frozen string, or...
rosenfeld (Rodrigo Rosenfeld Rosas)
01:05 AM Feature #11782: String#+@ and String#-@
Quoted from DevelopersMeeting20151021Japan log:
https://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20151021Japan https://docs.google.com/document/d/1axnQv1A2SdRExw--_RzXXJAPrRyvN7MCIB0WrKcZaSE/pub
> matz: i have another i...
ko1 (Koichi Sasada)
05:11 PM Bug #11784: [PATCH] insns.def (opt_case_dispatch): check Float#=== redefinition
Backported into `ruy_2_2` branch at r52977. nagachika (Tomoyuki Chikanaga)
04:49 PM Feature #11785 (Closed): add `encoding:` optional argument to `String.new`
Applied in changeset r52976.
----------
* string.c (rb_str_init): now accepts new option parameter `encoding'.
[Feature #11785]
usa (Usaku NAKAMURA)
03:50 PM Feature #11785: add `encoding:` optional argument to `String.new`
Agreed. I prefer `String.new("", encoding: 'utf-8')`.
Matz.
matz (Yukihiro Matsumoto)
09:41 AM Feature #11785: add `encoding:` optional argument to `String.new`
Another idea, `Encoding#string`, came in my mind.
~~~diff
diff --git a/encoding.c b/encoding.c
index eb777c9..f0001b3 100644
--- a/encoding.c
+++ b/encoding.c
@@ -1171,6 +1171,38 @@ enc_names(VALUE self)

/*
* call-seq:
+...
nobu (Nobuyoshi Nakada)
02:33 AM Feature #11785 (Closed): add `encoding:` optional argument to `String.new`
I propose to add `encoding:` optional argument to `String.new`.
Ruby doesn't have the syntax to specify the encoding of a string literal.
So we're using `String#force_encoding` for the purpose when writing m17n script, just like:
...
usa (Usaku NAKAMURA)
04:47 PM Bug #11775: Backport r52892 (fix the argument order of ATOMIC_SIZE_CAS)
Backported into `ruby_2_2` branch at r52975. nagachika (Tomoyuki Chikanaga)
02:54 AM Bug #11775: Backport r52892 (fix the argument order of ATOMIC_SIZE_CAS)
ruby_2_1 r52934 merged revision(s) 52892. usa (Usaku NAKAMURA)
04:45 PM Bug #11760: Encoding is tainted unexpectedly by Marshal.load
Backported into `ruby_2_2` branch at r52974. nagachika (Tomoyuki Chikanaga)
02:51 AM Bug #11760: Encoding is tainted unexpectedly by Marshal.load
ruby_2_1 r52933 merged revision(s) 52856,52906. usa (Usaku NAKAMURA)
04:26 PM Bug #11733: Compile of ruby 2.2.3 fails on AIX 6.1 TL07 SP03
Backported into `ruby_2_2` branch at r52973. nagachika (Tomoyuki Chikanaga)
03:44 PM Feature #11777: Change NameError#local_variables to return the list of local variables where the method is raised
Yes, this method is only for did_you_mean gem. nobu (Nobuyoshi Nakada)
12:34 PM Feature #11777: Change NameError#local_variables to return the list of local variables where the method is raised
NEWS does not mention about this feature.
Is it intended?
znz (Kazuhiro NISHIYAMA)
05:27 AM Feature #11777 (Closed): Change NameError#local_variables to return the list of local variables where the method is raised
Applied in changeset r52942.
----------
error.c: name_err_local_variables
* error.c (name_err_local_variables): new method
NameError#local_variables for internal use only.
[Feature #11777]
nobu (Nobuyoshi Nakada)
03:10 PM Bug #11199: IO.copy_stream degrade that can't call pathname to pathname
Thank you all! ksss (Yuki Kurihara)
03:05 PM Misc #11789 (Closed): [PATCH] Refactor File::Stat#world_readable? and #world_writable?
I fix to call **get_stat()** only once. ksss (Yuki Kurihara)
01:59 PM Feature #11788 (Closed): New ISeq serialize binary format
Applied in changeset r52949.
----------
* introduce new ISeq binary format serializer/de-serializer
and a pre-compilation/runtime loader sample.
[Feature #11788]
* iseq.c: add new methods:
* RubyVM::InstructionSequence#to_binary_...
ko1 (Koichi Sasada)
12:55 PM Feature #11788: New ISeq serialize binary format
Good question. I never take notice about that.
Try resolv.rb with use to_a/load_iseq.
```
user system total real
compile 10.590000 0.270000 10.860000 ( 11.452102)
compile 10.580000 0...
ko1 (Koichi Sasada)
11:48 AM Feature #11788: New ISeq serialize binary format
[email protected] wrote:
> * RubyVM::InstructionSequence#to_binary_format returns binary format data as String object.
> * RubyVM::InstructionSequence.from_binary_format(data) de-serialize it.

Why a new custom binary format instead of ...
normalperson (Eric Wong)
10:56 AM Feature #11788 (Closed): New ISeq serialize binary format
# Abstract
I wrote a new RubyVM::InstructionSequence (ISeq) object serializer and de-serializer binary format.
Matz had approved to introduce this feature to Ruby 2.3 as *experimental* feature.
So I'll commit them.
There are two ...
ko1 (Koichi Sasada)
01:20 PM Bug #10398: Server Name Indication support broken when reusing a (dead) session
#11401 solves this issue. mkarnebeek (Michiel Karnebeek)
11:25 AM Misc #11783: Do you have any idea if you have a budgets?
Martin Dürst wrote:
> > I should note that mswin CI will be given up just after Ruby 2.3 release because I can never keep its cost.
> ...
The former. It costs about $130 per month.
usa (Usaku NAKAMURA)
06:15 AM Misc #11783: Do you have any idea if you have a budgets?
Usaku NAKAMURA wrote:
> I should note that mswin CI will be given up just after Ruby 2.3 release because I can never keep its cost.
Does this mean cost of infrastructure (which can be paid for) or cost of your work (which may be ve...
duerst (Martin Dürst)
08:28 AM Feature #11786: [PATCH] micro-optimize case dispatch even harder
SASADA Koichi <[email protected]> wrote:
> On 2015/12/08 13:53, Eric Wong wrote:
> >> > how to mark literal objects?
> > Take ideas from nobu (r52708 :)
>
> I meant marking, not for freeing a table.

Oops :x I added rb_mark_set to...
normalperson (Eric Wong)
05:48 AM Feature #11786: [PATCH] micro-optimize case dispatch even harder
On 2015/12/08 13:53, Eric Wong wrote:
>> > how to mark literal objects?
> Take ideas from nobu (r52708 :)

I meant marking, not for freeing a table.

For example, bignum objects should mark from this table.

```ruby
case nil
w...
ko1 (Koichi Sasada)
05:18 AM Feature #11786: [PATCH] micro-optimize case dispatch even harder
Full v2 patch including leak fix with wrapper object:

http://80x24.org/spew/20151208050811.6803-1-e%4080x24.org/t/raw

Slightly smaller improvements with leak fix, but it could be noise
for the small cases.

2015-12-08 05:06:17 ...
normalperson (Eric Wong)
04:58 AM Feature #11786: [PATCH] micro-optimize case dispatch even harder
SASADA Koichi <[email protected]> wrote:
> On 2015/12/08 12:43, Eric Wong wrote:
> > Oops, I forgot to free the table when iseq is destroyed :x
> > Update coming...
>
> how to mark literal objects?

Take ideas from nobu (r52708 :)
...
normalperson (Eric Wong)
03:58 AM Feature #11786: [PATCH] micro-optimize case dispatch even harder
On 2015/12/08 12:43, Eric Wong wrote:
> Oops, I forgot to free the table when iseq is destroyed :x
> Update coming...
>

how to mark literal objects?


BTW, I'm writing new iseq dumper and loader.
it is some tough timing such ...
ko1 (Koichi Sasada)
03:48 AM Feature #11786: [PATCH] micro-optimize case dispatch even harder
Oops, I forgot to free the table when iseq is destroyed :x
Update coming...
normalperson (Eric Wong)
03:36 AM Feature #11786 (Open): [PATCH] micro-optimize case dispatch even harder
I noticed these optimizations while working on r52931.
By using a bare hash table, we avoid the overhead of rb_hash_*
functions as well as the cost of translating FIX2INT for jump
labels.
This also reduces GC overhead, as the ise...
normalperson (Eric Wong)
07:31 AM Bug #11787: rb_inspect() should check Encoding.default_internal instead of Encoding.default_external
Shugo Maeda wrote:
> Encoding.default_internal should be check instead.
I've attached a patch.
shugo (Shugo Maeda)
07:24 AM Bug #11787 (Closed): rb_inspect() should check Encoding.default_internal instead of Encoding.default_external
rb_inspect() checks Encoding.default_external even if Encoding.default_internal is specified.
```
$ cat t.rb
puts "\u3042"
p "\u3042"
$ ruby -E windows-31j:utf-8 t.rb

t.rb:2:in `p': inspected result must be ASCII only or use t...
shugo (Shugo Maeda)
07:24 AM Feature #11773 (Closed): Enumerator::Lazy#grep_v
Applied in changeset r52943.
----------
enumerator.c: lazy_grep_v
* enumerator.c (lazy_grep_v): add Enumerator::Lazy#grep_v as well
as Enumerable, to enumerate lazily.
[ruby-core:71845] [Feature #11773]
nobu (Nobuyoshi Nakada)
06:41 AM Bug #11718: Constant access on `nil`
@Koichi: good that you classify it, for a moment i thought that might be an feature ;P Hanmac (Hans Mackowiak)
04:04 AM Bug #11780 (Closed): TestIO_Console#test_getpass failed on Solaris
Applied in changeset r52937.
----------
* test/io/console/test_io_console.rb (test_getpass): s.getpass
should be tested. Narrow ensure block. This reverts r52911.
[Bug #11780] [ruby-dev:49412]
ngoto (Naohisa Goto)
04:03 AM Bug #11762: Array#dig can raise TypeError: no implicit conversion of Symbol/String into Integer
Here is my suggested documentation on how `Hash#dig` should behave as part of a general `dig` protocol. The patch includes equivalent changes to the documentation for `Array#dig`.
~~~
* Extracts a nested value by navigating the giv...
colindkelley (Colin Kelley)
03:09 AM Bug #11762: Array#dig can raise TypeError: no implicit conversion of Symbol/String into Integer
The current doc also gives examples that should return raise an error, if I understand correctly:
a = [[1, [2, 3]]]
a.dig(0, 0, 0) #=> nil
Since `1.dig(0)` is invalid (and 1 is not `nil`), that should r...
marcandre (Marc-Andre Lafortune)
01:35 AM Bug #11762: Array#dig can raise TypeError: no implicit conversion of Symbol/String into Integer
> I'd guess, like Colin, that returning nil is probably the best. Makes debugging harder when writing new code, but makes backward compatibility easier, since old code using dig wouldn't bomb if the data layout changes in the future.
...
colindkelley (Colin Kelley)
01:33 AM Bug #11762 (Open): Array#dig can raise TypeError: no implicit conversion of Symbol/String into Integer
Reopening, since \the following should raise an error:
{a: 'hello'}.dig(:a, :b) # => nil, should raise an Error
Right?
marcandre (Marc-Andre Lafortune)
03:43 AM Feature #9098: Indent heredoc against the left margin by default when "indented closing identifier" is turned on.
This change actually introduces a syntactic incompatibility. Is this okay? I have not seen any real-life use-case that suffers from this incompatibility, though.
~~~
def foo
42
end
BAR = -10
p foo <<~BAR
~~~
~~~
$ ruby -...
mame (Yusuke Endoh)
12:10 AM Feature #9098: Indent heredoc against the left margin by default when "indented closing identifier" is turned on.
Hey, nobu, write NEWS!! usa (Usaku NAKAMURA)
03:11 AM Bug #8543: new rb_iseq_load crash
2.0/2.1 use different code about r51816.
So they don't have this problem, I think.
usa (Usaku NAKAMURA)
01:47 AM Feature #11769 (Closed): optimize case / when for `nil`
Applied in changeset r52931.
----------
compile optimized case dispatch for nil/true/false
nil/true/false are special literals just like floats, integers,
literal strings, and symbols. Optimize when statements with
them by using a jum...
Anonymous
12:28 AM Feature #11769: optimize case / when for `nil`
Eric Wong <[email protected]> wrote:
> Cool. Might be worth it to do the same for `true` and `false`,
> too, since we have space for them.

Sythetic benchmark shows a 3x speedup on top of r52928:

http://80x24.org/spew/201512...
normalperson (Eric Wong)

12/07/2015

11:57 PM Bug #11784 (Closed): [PATCH] insns.def (opt_case_dispatch): check Float#=== redefinition
Applied in changeset r52928.
----------
insns.def (opt_case_dispatch): check Float#=== redefinition
The missing check for Float#=== redefinition was noticed while
working on enhancing optimized case dispatch for nil/true/false
in [ruby...
Anonymous
11:54 PM Bug #11784 (Closed): [PATCH] insns.def (opt_case_dispatch): check Float#=== redefinition
insns.def (opt_case_dispatch): check Float#=== redefinition
The missing check for Float#=== redefinition was noticed while
working on enhancing optimized case dispatch for nil/true/false
in [ruby-core:71818] https://bugs.ruby-lang.o...
normalperson (Eric Wong)
09:18 PM Bug #11733: Compile of ruby 2.2.3 fails on AIX 6.1 TL07 SP03
r50423 will be soon back-ported to the 2.2 branch.
In the meantime, I believe you can avoid the compile error by the following patch.
~~~diff
--- ruby-2.2.3/ext/-test-/file/fs.c 2015-05-23 10:15:12.000000000 -0700
+++ ../Cont...
ReiOdaira (Rei Odaira)
05:08 PM Bug #11733 (Closed): Compile of ruby 2.2.3 fails on AIX 6.1 TL07 SP03
usa (Usaku NAKAMURA)
05:43 PM Bug #11779: Module#using does not make sense as a method
Yukihiro Matsumoto wrote:
> Providing a feature by a method does not imply dynamic scoping, for example, Module#private etc. work in lexical scope.
> ...
actually `private` is more dynamic than `using`, here's an example of private wor...
bughit (bug hit)
05:21 PM Bug #11779: Module#using does not make sense as a method
Yukihiro Matsumoto wrote:
> Providing a feature by a method does not imply dynamic scoping, for example, Module#private etc. work in lexical scope.
> ...
Well, since it's an established pattern, one has to just accept it. It does seem...
bughit (bug hit)
05:00 PM Bug #11779: Module#using does not make sense as a method
Providing a feature by a method does not imply dynamic scoping, for example, Module#private etc. work in lexical scope.
Matz.
matz (Yukihiro Matsumoto)
04:09 PM Bug #11779: Module#using does not make sense as a method
Yukihiro Matsumoto wrote:
> Can elaborate what do you want if `using` should not be a method.
> ...
I don't know what possibilities there are, it just struck me that it was not behaving at all as a method, methods affect their dynamica...
bughit (bug hit)
06:52 AM Bug #11779 (Feedback): Module#using does not make sense as a method
Can elaborate what do you want if `using` should not be a method.
Considering a new keyword would break existing code, I don't think it's a good idea.
Matz.
matz (Yukihiro Matsumoto)
05:03 PM Bug #11771: unable to pass keyargs to []=
I don't say anything about 3.0 for now.
But things are more complicated than you imagine.
Matz.
matz (Yukihiro Matsumoto)
04:02 PM Bug #11771: unable to pass keyargs to []=
Yukihiro Matsumoto wrote:
> Pending, for several reasons:
> ...
`def []=(k,opt={},v)` feels wrong because you're taking a dependency on incorrect behavior (method dispatch that puts a positional arg after the keyargs) Why not correct ...
bughit (bug hit)
07:03 AM Bug #11771 (Closed): unable to pass keyargs to []=
Pending, for several reasons:
(1) compatibility. `a[a,foo:1]=v` is valid code. changing behavior may crash existing code.
(2) you can delegate to other method e.g.
```ruby
def opt_aset(k,v,option:nil)
...
end
def []=(k,opt...
matz (Yukihiro Matsumoto)
03:59 PM Bug #11759: URI breaks with frozen strings
> I prefer String.new() to "".dup because the former describes intention (of creating a buffer).
Ok. I've attached a rev3 patch that uses `String.new` instead of `''.dup`.
> ...
I had a question about that but I saw it answered els...
colindkelley (Colin Kelley)
07:19 AM Bug #11759: URI breaks with frozen strings
I prefer `String.new()` to `"".dup` because the former describes intention (of creating a buffer).
In fact, my best choice is introducing `String#+` that returns a mutable copy of a string.
For the size of byte code and performance, ...
matz (Yukihiro Matsumoto)
03:19 PM Feature #11782: String#+@ and String#-@
The purpose of this proposal is to encourage frozen string literals and provide better way than `"foo".dup`. So that `String#-@` can be redundancy. ko1 (Koichi Sasada)
03:14 PM Feature #11782 (Assigned): String#+@ and String#-@
Endo-san pointed out that `+foo.upcase!` is evaluated as `+(foo.upcase!)`.
It can be problem. But any practical examples?
Mutate operations such as `str = +'foo' << bar << baz` works (because +@ is stronger than <<).
Evaluation wi...
ko1 (Koichi Sasada)
03:10 PM Feature #11782 (Closed): String#+@ and String#-@
Applied in changeset r52917.
----------
* string.c: introduce String#+@ and String#-@ to control
String mutability.
[Feature #11782]
ko1 (Koichi Sasada)
02:05 PM Feature #11782: String#+@ and String#-@
+1
--
Yusuke Endoh <[email protected]>
mame (Yusuke Endoh)
12:58 PM Feature #11782: String#+@ and String#-@
It's OK if we don't have strong objection.
Matz.
matz (Yukihiro Matsumoto)
10:13 AM Feature #11782 (Closed): String#+@ and String#-@
Matz said
> In fact, my best choice is introducing `String#+` that returns a mutable copy of a string.
[ruby-core:71879] [Ruby trunk - Bug #11759]
So that this is a ticket for that.
I'll commit it ASAP to check this methods bef...
ko1 (Koichi Sasada)
03:19 PM Feature #9098: Indent heredoc against the left margin by default when "indented closing identifier" is turned on.
Ah, for some reason I was under the impression that the plan was to use the indentation from the first non-blank line to determine how much to dedent the entire string.
If the plan instead is to use the least-indented non-blank line f...
Ajedi32 (Ajedi32 W)
02:40 PM Feature #9098 (Closed): Indent heredoc against the left margin by default when "indented closing identifier" is turned on.
Applied in changeset r52916.
----------
parse.y: indented hereoc
* parse.y: add heredoc <<~ syntax. [Feature #9098]
nobu (Nobuyoshi Nakada)
06:45 AM Feature #9098: Indent heredoc against the left margin by default when "indented closing identifier" is turned on.
Alternative 2 looks good to me.
Matz.
matz (Yukihiro Matsumoto)
02:19 PM Feature #11735: Porting String#squish and String#squish! from Ruby on Rails' Active Support
nobu's patch seems to be the better way to implement this feature without having to use regular expression. Much more efficient.
I guess I should try to think outside the box the next time I try to write something in C.
+1 to nobu'...
sikachu (Prem Sichanugrist)
07:51 AM Feature #11735: Porting String#squish and String#squish! from Ruby on Rails' Active Support
https://github.com/ruby/ruby/compare/trunk...nobu:feature/11735-squish nobu (Nobuyoshi Nakada)
02:08 PM Bug #11730 (Closed): read_nonblock's call-seq missing options
Applied in changeset r52914.
----------
add missing options to call-seq of IO#read_nonblock
* prelude.rb (IO#read_nonblock): [DOC] add missing options to
call-seq. [ruby-core:71627] [Bug #11730]
Anonymous
11:47 AM Misc #11783: Do you have any idea if you have a budgets?
Koichi Sasada wrote:
> > nurse: VPS severs for CI are welcome. Especially for Azure.
I should note that mswin CI will be given up just after Ruby 2.3 release because I can never keep its cost.
usa (Usaku NAKAMURA)
10:29 AM Misc #11783 (Closed): Do you have any idea if you have a budgets?
Do you have any idea about Ruby interpreter implementation to do with budgets?
# Background
Now, we are summarizing many contributions from many people, organizations and companies.
https://docs.google.com/document/d/1y1sQc40qeu...
ko1 (Koichi Sasada)
11:22 AM Feature #11737: Pass in expression to then block in `case expression`
Thank you. I appreciate your consideration. danielpclark (Daniel P. Clark)
07:41 AM Feature #11737 (Rejected): Pass in expression to then block in `case expression`
It's not worth adding special expression or variable for retrieving the when value.
Just use assignment.
Matz.
matz (Yukihiro Matsumoto)
11:13 AM Feature #11781: Would it be possible to alias .prepend() towards .unshift() for class Array by default?
`prepend` is already a keyword in the Ruby language for prepending a module in the ancestry chain: http://ruby-doc.org/core-2.2.3/Module.html#method-i-prepend danielpclark (Daniel P. Clark)
10:12 AM Feature #11781 (Open): Would it be possible to alias .prepend() towards .unshift() for class Array by default?
Hello.
For Strings we can do:
abc = 'world!'
abc[0,0] = 'Hello '
abc # => "Hello world!"
For Arrays we can do:
abc = ['world!']
abc[0,0] = 'Hello '
abc # => ["Hello ", "world!"]
This is nice.
...
shevegen (Robert A. Heiler)
10:54 AM Bug #11742: lib/webrick/utils.rb:196:in `register': ERROR RuntimeError: can't add a new key into hash during iteration
yuzo san が担当者一覧に見つかんなかったので、nahi さんにとりあえず振っておきます。
すみませんが、適切な方に delegate して頂けると。
ko1 (Koichi Sasada)
10:51 AM Bug #11718: Constant access on `nil`
* This is a bug, so that anyone should not rely on this behavior.
* This is a bug, so that this bug should be fixed
* But not critical, so 2.3 can remain this behavior. It should be fix in a future.
ko1 (Koichi Sasada)
09:15 AM Bug #11780 (Closed): TestIO_Console#test_getpass failed on Solaris
Solaris 10 にて、TestIO_Console#test_getpass が以下のエラーで失敗します。
~~~
1) Error:
TestIO_Console#test_getpass:
Errno::EINVAL: Invalid argument
/XXXXX/test/io/console/test_io_console.rb:190:in `getpass'
/XXXXX/test/io/console/test_...
ngoto (Naohisa Goto)
08:52 AM Misc #11770: [PATCH] $KCODEへの代入時にwarningが発生することのテストを追加
ありがとうございます:) yui-knk (Kaneko Yuichiro)
07:26 AM Misc #11770: [PATCH] $KCODEへの代入時にwarningが発生することのテストを追加
OK.
Matz.
matz (Yukihiro Matsumoto)
07:24 AM Misc #11770: [PATCH] $KCODEへの代入時にwarningが発生することのテストを追加
ご自分でコミットなさるのがよいのではないでしょうか。
よいですよね>matz
redmineのruby-coreグループには追加したので、その他の手続きお願いします>しばたさん
naruse (Yui NARUSE)
07:52 AM Feature #11734 (Closed): Improved ternary operator
ko1 (Koichi Sasada)
07:43 AM Bug #11736: Float(arg) not consistent with documentation
Document is wrong.
Zack, could you fix it?
ko1 (Koichi Sasada)
07:33 AM Bug #11740: ObjectSpace.each_object exposes internal metaclasses
I'll fix it. ko1 (Koichi Sasada)
07:29 AM Feature #11747 (Rejected): "bury" feature, similar to 'dig' but opposite
It's not clear to generate either Hash, Array, or Struct (or whatever) to bury a value.
So it's better to reject now.
Matz.
matz (Yukihiro Matsumoto)
07:28 AM Bug #11743 (Closed): r52758 以降 config.guess がダウンロードできない
naruse (Yui NARUSE)
07:23 AM Feature #11758: Add keyword assignment syntax
discuss for 2.4 and later ko1 (Koichi Sasada)
07:08 AM Feature #11761 (Rejected): `Hash#default_set` and `Hash#default_proc_set`
Use `tap`. Methods with side-effect should be handled with care. Making it chainable has little benefit.
Matz.
matz (Yukihiro Matsumoto)
07:06 AM Bug #11762 (Rejected): Array#dig can raise TypeError: no implicit conversion of Symbol/String into Integer
I believe `dig` should only ignore nil receiver as its description.
Hiding argument/type error is not a good idea, I think.
Matz.
matz (Yukihiro Matsumoto)
07:03 AM Bug #11765 (Third Party's Issue): Trouble using fiddle to call Fortran from C
ko1 (Koichi Sasada)
06:53 AM Bug #11776: dig and custom objects
Confirmed. ;-)
Matz.
matz (Yukihiro Matsumoto)
06:49 AM Misc #11757 (Closed): test_string.rbから不要なコードを削除する
nobu (Nobuyoshi Nakada)
05:26 AM Feature #11777: Change NameError#local_variables to return the list of local variables where the method is raised
It's OK to add. But I think we should mark it as 'internal use' in the reference.
Matz.
matz (Yukihiro Matsumoto)
05:16 AM Feature #11773: Enumerator::Lazy#grep_v
Agreed. the patch LGTM.
Matz.
matz (Yukihiro Matsumoto)

12/06/2015

09:40 PM Bug #11779 (Feedback): Module#using does not make sense as a method
1. it can't be called from another method
2. the receiver must be self
3. since refinements are lexically scoped the self receiver must match the currently open class
#3 is particularly curious
```ruby
module Refinement
refin...
bughit (bug hit)
08:48 PM Feature #11588: Implement structured warnings
#3 is a big deal IMHO. Having finer-grained control over which warnings are
shown is long overdue.

On Tue, Oct 13, 2015 at 11:25 AM <[email protected]> wrote:

> Issue #11588 has been reported by Daniel Berger.
>
> ------------...
avdi (Avdi Grimm)
04:21 AM Feature #11588: Implement structured warnings
Matz, warnings may not affect control flow, but I've seen enough real world application logs filled with warnings we couldn't control to dispute your assertion that they don't need to be handled by machines. And right now they can't real... djberg96 (Daniel Berger)
02:27 PM Bug #11778 (Closed): recv_io with mode breaks when klass arg is kind of BasicSocket
Following test show the failure in the second recv_io call.
I was writing additional tests for FD passing when I noticed this.
I'm not sure if BasicSocket.for_fd should do with the mode flag if
we change its arity...
~~~
--- a/t...
normalperson (Eric Wong)
01:18 PM Feature #11664: [PATCH] introduce rb_autoload_value to replace rb_autoload
[email protected] wrote:
> I don't think there is good enough reason to deprecate `rb_autoload`.

Who uses rb_autoload from C extensions?
It is not performance-critical.

I'd like to make the C API smaller so we can have less to ...
normalperson (Eric Wong)
12:30 PM Feature #11664: [PATCH] introduce rb_autoload_value to replace rb_autoload
I don't think there is good enough reason to deprecate `rb_autoload`. nobu (Nobuyoshi Nakada)
12:28 PM Feature #11664 (Closed): [PATCH] introduce rb_autoload_value to replace rb_autoload
Applied in changeset r52909.
----------
introduce rb_autoload_str to replace rb_autoload
rb_autoload_str may be safer by preventing premature GC. It
can also be more efficient by passing a pre-frozen string that
can be deduped using r...
Anonymous
12:43 PM Feature #11777: Change NameError#local_variables to return the list of local variables where the method is raised
Do you want to **add** `NameError#local_variables`? nobu (Nobuyoshi Nakada)
06:15 AM Feature #11777 (Closed): Change NameError#local_variables to return the list of local variables where the method is raised
Sasada-san and I talked about this briefly a few weeks ago, but I also wanted to let others know about this.
This change will make it possible to pull out the list of local variables where the exception is raised without TracePoint. T...
yuki24 (Yuki Nishijima)
11:53 AM Bug #11776: dig and custom objects
There is already a spec for this behavior though :)
https://github.com/ruby/rubyspec/blob/master/core/hash/dig_spec.rb
Eregon (Benoit Daloze)
05:18 AM Bug #11776 (Closed): dig and custom objects
Although currently undocumented and untested, it is possible to `dig` objects of any class that implements `dig`:
class Foo
def dig(x, *)
40 + x
end
end
{hello: Foo.new}.dig(:hello, 2) # => 42
...
marcandre (Marc-Andre Lafortune)
06:10 AM Bug #11774: OpenSSL::PKey.read produces ArgumentError on invalid passphrases
Seems that OpenSSL doesn't tell what kind failure happened. nobu (Nobuyoshi Nakada)
05:11 AM Bug #11762: Array#dig can raise TypeError: no implicit conversion of Symbol/String into Integer
I feel that either `dig` should be safe only against `nil` somewhere in the digging path (a bit like `&.`), or it's should always safe, even when digging through unexpected objects or indices.
Currently:
{a: 'hello'}.dig(:a, :b...
marcandre (Marc-Andre Lafortune)
04:37 AM Bug #11772: Implicit conversion of Array in String interpolation does not call to_str
~~~ruby
class A
undef :to_s
def to_str
"hello world"
end
end
"#{A.new}"
#NoMethodError: undefined method `to_s' for #<A:0x00000000dbea70>
"" + A.new
# => "hello world"
~~~
Using `+` to call `to_str` feels like...
danielpclark (Daniel P. Clark)
03:13 AM Feature #9451: Refinements and unary & (to_proc)
Is there any update on this feature? In Ruby 2.2.3 I still run into a problem where the unary & can not be used when the method was added with a refinement, such as the following:
```ruby
module Example
refine String do
def p...
justcolin (Colin Fulton)

12/05/2015

07:01 PM Bug #11775 (Closed): Backport r52892 (fix the argument order of ATOMIC_SIZE_CAS)
このチケットはバックポート管理用です。
r52892 で修正されている InterlockedCompareExchange64() を使った ATOMIC_SIZE_CAS() の修正部分は 2.0.0〜2.2 も同様なのでバックポート必要そうです。
nagachika (Tomoyuki Chikanaga)
04:54 PM Bug #11774 (Third Party's Issue): OpenSSL::PKey.read produces ArgumentError on invalid passphrases
If we try to read out an RSA encrypted key with an invalid passphrase like so:
```ruby
require 'openssl'
OpenSSL::PKey.read(File.read("#{ENV['HOME']}/.ssh/id_rsa"), 'invalid')
```
We get an argument error:
```
ArgumentError: C...
temikus (Artem Yakimenko)
04:32 PM Bug #11762: Array#dig can raise TypeError: no implicit conversion of Symbol/String into Integer
> I think it should return nil in this case.
Anyone else have an opinion?
colindkelley (Colin Kelley)
04:20 PM Bug #11759: URI breaks with frozen strings
> Outputs:
> ...
That is more significant than I thought. `''.dup` wins.
> No, we shouldn't worry about performance with older versions of Ruby
> ...
Good to have that confirmed. Then we should definitely leave the magic comment at...
colindkelley (Colin Kelley)
10:47 AM Misc #11770: [PATCH] $KCODEへの代入時にwarningが発生することのテストを追加
> 将来的には$KCODEの特別扱いをなしにしたい
$KCODEを削除するという意味でしょうか?
現時点ではwarningがでることをテストしておいてもいいのかなと思っています。
> ...
誤解していました、ありがとうございます。
`test_KCODE_warning`と`test_ignorecase_warning`に分割します。
また細かい修正になりますが、以下のテストの3・4番目のasserttionを`test_ignorecase`に切...
yui-knk (Kaneko Yuichiro)
08:26 AM Bug #8822 (Closed): Incorrect encoding for ENV in Windows
Applied in changeset r52896.
----------
hash.c: env encoding fallback on Windows
* hash.c (env_str_new, env_path_str_new): make default string
UTF-8 for the case conversion is not possible. [Bug #8822]
* hash.c (get_env_cstr): conve...
nobu (Nobuyoshi Nakada)
07:58 AM Feature #11537 (Closed): Introduce "Safe navigation operator"
Applied in changeset r52895.
----------
node.c: NODE_QCALL
* node.c (dump_node): dump NODE_QCALL. [Feature #11537]
http://twitter.com/watson1978/status/673042429931446272
nobu (Nobuyoshi Nakada)
07:33 AM Feature #11773 (Closed): Enumerator::Lazy#grep_v
`Enumerable#grep_v` was introduced in #11049.
But `Enumerator::Lazy` doesn't have the method.
I've attached a patch that adds `grep_v` to `Enumerator::Lazy`.
spiritloose (Jiro Nishiguchi)
05:54 AM Bug #11772 (Closed): Implicit conversion of Array in String interpolation does not call to_str
As (implicitly) requested at ruby-core:71843. duerst (Martin Dürst)
05:32 AM Bug #11772: Implicit conversion of Array in String interpolation does not call to_str
My main point here is that anything that happens within String interpolation is "implicitly" going to be a String. So shouldn't it call `to_str` before `to_s` on anything given?
~~~ruby
class B
def to_str
"Hello from B"
e...
danielpclark (Daniel P. Clark)
05:22 AM Bug #11772 (Closed): Implicit conversion of Array in String interpolation does not call to_str
While providing an example in https://bugs.ruby-lang.org/issues/10930#note-7 I found that the implicit changing of an Array calls to_s without trying to_str first. Isn't String interpolation "implicitly" converting items to strings?
...
danielpclark (Daniel P. Clark)
04:53 AM Feature #10930: Allow splat operator to work for string interpolation
To better demonstrate the pain point here.
~~~ruby
class Example
def method_missing m, *a
puts "Method #{m} called with arguments ", *a
end
end
Example.new.foo :bar, :baz
#Method foo called with arguments
#bar
#baz...
danielpclark (Daniel P. Clark)
03:23 AM Bug #9715: ENV data yield ASCII-8BIT encoded strings under Windows with unicode username
Agreed: although Ruby 2.2 appears to be trying to use locale to determine the encoding for environment vars, it's not producing reasonable results on Windows. (E.g. w32_getenv() in hash.c, and also putenv() in hash.c)
Its current beh...
spatulasnout (B Kelly)
 

Also available in: Atom