[#89555] [Ruby trunk Feature#15251] Hash aset should deduplicate non tainted string — chopraanmol1@...
Issue #15251 has been updated by chopraanmol1 (Anmol Chopra).
3 messages
2018/10/25
[#89583] [PATCH] vm_trace.c (postponed_job_register): only hit main thread — Eric Wong <normalperson@...>
@hsbt: I post here on ruby-core because I hit errors with
5 messages
2018/10/27
[#89584] Re: [PATCH] vm_trace.c (postponed_job_register): only hit main thread
— Koichi Sasada <ko1@...>
2018/10/27
thank you for you patch.
[#89590] Re: [PATCH] vm_trace.c (postponed_job_register): only hit main thread
— Eric Wong <normalperson@...>
2018/10/28
Koichi Sasada <ko1@atdot.net> wrote:
[#89621] [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process — Greg.mpls@...
Issue #14867 has been updated by MSP-Greg (Greg L).
4 messages
2018/10/29
[#89622] Re: [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process
— Eric Wong <normalperson@...>
2018/10/29
Greg.mpls@gmail.com wrote:
[#89627] [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process — takashikkbn@...
Issue #14867 has been updated by k0kubun (Takashi Kokubun).
3 messages
2018/10/30
[#89654] [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process — takashikkbn@...
Issue #14867 has been updated by k0kubun (Takashi Kokubun).
4 messages
2018/10/31
[#89655] Re: [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process
— Eric Wong <normalperson@...>
2018/10/31
takashikkbn@gmail.com wrote:
[ruby-core:89398] [Ruby trunk Misc#15224] [DOCs] Minor inconsistency in class Array #initialize_copy - https://ruby-doc.org/core-2.5.1/Array.html#method-i-initialize_copy
From:
shevegen@...
Date:
2018-10-13 10:18:58 UTC
List:
ruby-core #89398
Issue #15224 has been reported by shevegen (Robert A. Heiler).
----------------------------------------
Misc #15224: [DOCs] Minor inconsistency in class Array #initialize_copy - https://ruby-doc.org/core-2.5.1/Array.html#method-i-initialize_copy
https://bugs.ruby-lang.org/issues/15224
* Author: shevegen (Robert A. Heiler)
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
Today I looked at:
https://ruby-doc.org/core-2.5.1/Array.html#method-i-initialize_copy
The example to this method is this:
a = [ "a", "b", "c", "d", "e" ]
a.replace([ "x", "y", "z" ]) #=> ["x", "y", "z"]
a #=> ["x", "y", "z"]
What confused me was that I was looking at the method called initialize_copy
but the example showed .replace().
I then looked at #replace there:
https://ruby-doc.org/core-2.5.1/Array.html#method-i-replace
And it was virtually identical to initialize_copy.
I assume the examples for .replace() are correct; and perhaps initialize_copy
is just an alias? I am not sure, but I would like to suggest to make the documentation,
in particular the example, a bit more consistent.
When you click on "view source" to look at the C code, they show the very same
content, so I believe that initialize_copy is merely an alias to replace; but I tried
this and they are not fully equivalent:
x = [1,2,3] # => [1, 2, 3]
x.initialize_copy [4,5,6]
Traceback (most recent call last):
2: from /System/Index/bin/irb:11:in `<main>'
1: from (irb):2
NoMethodError (private method `initialize_copy' called for [1, 2, 3]:Array)
Yet:
x.replace [4,5,6] # => [4, 5, 6]
works. So I assume that initialize_copy is like .replace() but is a private
method instead.
Perhaps it may help to add a sentence below the documentation of
replace(), to explain what the use case for initialize_copy is. Or to perhaps
mention that it is an alias.
At the least how it is right now is that people may read initialize_copy,
but then see an example of #replace. (Perhaps an example for
initialize_copy may help, but either way, I think the current docu-example
is not ideal).
--
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>