[#26972] How to — HackerGene <hackergene@...>
Hi , I'm new to ruby programming language located in China.
[#26981] [Bug #2418] method_missing (assignment) returns args instead of return value — Dave B <redmine@...>
Bug #2418: method_missing (assignment) returns args instead of return value
[#27003] [Bug #2422] splat operator fails on array of 1 element — Raul Parolari <redmine@...>
Bug #2422: splat operator fails on array of 1 element
[#27014] possible bug in Method#source_location — Roger Pack <rogerdpack@...>
It appears that Method#source_location returns different values for
[#27025] [Backport #2431] StringIO#{gets,readlines} with "" (paragraph mode) trims last "\n" — Hiroshi NAKAMURA <redmine@...>
Backport #2431: StringIO#{gets,readlines} with "" (paragraph mode) trims last "\n"
Issue #2431 has been updated by Vladimir Sizikov.
2009/12/7 Vladimir Sizikov <redmine@ruby-lang.org>:
Hi,
Hi Vladimir,
[#27031] [Bug #2433] Ruby gem update --system /gem install [any_gem_name] ERROR — Sergueï Cambour <redmine@...>
Bug #2433: Ruby gem update --system /gem install [any_gem_name] ERROR
[#27036] Ruby causes nearly as much cpu wakeups as firefox — Christoph Kappel <unexist@...>
> =A020.5% (133.5) =A0 =A0 =A0 =A0 =A0 firefox : hrtimer_start_range_ns (hr=
>> =A020.5% (133.5) =A0 =A0 =A0 =A0 =A0 firefox : hrtimer_start_range_ns (h=
Hi,
[#27060] [Bug #2443] {Object,BasicObject}.clone — Shugo Maeda <redmine@...>
Bug #2443: {Object,BasicObject}.clone
[#27074] [Bug #2449] StringIO#ungetc behavior is contrary to its spec — Vladimir Sizikov <redmine@...>
Bug #2449: StringIO#ungetc behavior is contrary to its spec
Issue #2449 has been updated by Yusuke Endoh.
Hi,
[#27086] [Feature #2454] OpenSSL has no maintainer — Yui NARUSE <redmine@...>
Feature #2454: OpenSSL has no maintainer
Issue #2454 has been updated by Yui NARUSE.
[#27103] [Bug #2464] cross-compile Ruby patchlevel 376 fails — Luis Lavena <redmine@...>
Bug #2464: cross-compile Ruby patchlevel 376 fails
[#27120] #to_enum ignores block? — Roger Pack <rogerdpack@...>
Is #to_enum ignoring its block expected?
On Thu, Dec 10, 2009 at 7:55 AM, Roger Pack <rogerdpack@gmail.com> wrote:
> The whole purpose of to_enum is to return an Enumerator instance.
On Thu, Dec 10, 2009 at 9:58 AM, Roger Pack <rogerdpack@gmail.com> wrote:
[#27135] better GC? — Roger Pack <rogerdpack@...>
Could I put in a small plea for a better GC?
Hi,
On Fri, Dec 11, 2009 at 09:07:16AM +0900, Yukihiro Matsumoto wrote:
Excerpts from Paul Brannan's message of Thu Jan 07 21:53:34 +0200 2010:
Eero Saynatkari wrote:
> Rubinius is also compatible with existing extensions*
Excerpts from rogerdpack2's message of Fri Jan 08 18:41:18 +0200 2010:
>> I wonder if its GC could be merged into MRI :)
On Tue, Jan 12, 2010 at 12:45 PM, Evan Phoenix <evan@fallingsnow.net> wrote=
Paul Brannan wrote:
On Fri, Jan 08, 2010 at 07:37:40AM +0900, Kurt Stephens wrote:
On Tue, Jan 12, 2010 at 3:23 AM, Brent Roman <brent@mbari.org> wrote:
> Toshio Endo and Kenjiro Taura adapted the Boehm conservative GC
On Thu, Jan 14, 2010 at 15:06, Roger Pack <rogerdpack2@gmail.com> wrote:
[#27142] Ruby's GC — Gon軋lo Silva <goncalossilva@...>
Hi there,
Hi,
On Fri, Dec 11, 2009 at 9:40 AM, Yukihiro Matsumoto <matz@ruby-lang.org> wr=
[#27151] [Bug #2475] InstructionSequence#to_a fails for duparray — Paul Brannan <redmine@...>
Bug #2475: InstructionSequence#to_a fails for duparray
[#27169] [Feature #2480] request to add GC::Profiler.time method — Roger Pack <redmine@...>
Feature #2480: request to add GC::Profiler.time method
[#27189] [ANN] openssl-nonblock 0.2.1: moving towards compatibility with Ruby 1.9.2 — Tony Arcieri <tony@...>
openssl-nonblock is a gem which enables non-blocking support in Ruby's
[#27198] [PATCH] fix CGI::escape to work with blocks, avoid dollar variables — Gaston Ramos <ramos.gaston@...>
Hi Ruby-Core, I attach a path that solve this problem:
On Thu, Dec 17, 2009 at 12:28 AM, Gaston Ramos <ramos.gaston@gmail.com>wrote:
El Thu, 17 de Dec de 2009, a las 11:20:32AM +0900, NARUSE, Yui dijo:
(2009/12/17 21:16), Gaston Ramos wrote:
[#27199] [Backport #2488] thread usage can result in bad HANDLE — Roger Pack <redmine@...>
Backport #2488: thread usage can result in bad HANDLE
Issue #2488 has been updated by _ wanabe.
[#27205] unable to send signal "EXIT" — Roger Pack <rogerdpack@...>
Is this expected? (all versions of ruby...)
Hello,
[#27223] [Bug #2495] Matrix: Vector#each2 should check its argument — Marc-Andre Lafortune <redmine@...>
Bug #2495: Matrix: Vector#each2 should check its argument
[#27224] [Bug #2496] Delegate: #methods and #public_methods should return delegated methods too — Marc-Andre Lafortune <redmine@...>
Bug #2496: Delegate: #methods and #public_methods should return delegated methods too
Issue #2496 has been updated by Yusuke Endoh.
[#27230] [Bug #2502] strange behavior of anonymous class inside a proc — caleb clausen <redmine@...>
Bug #2502: strange behavior of anonymous class inside a proc
[#27238] Why doesn't Array include Comparable? — Martin DeMello <martindemello@...>
Array already defines <=>, why not include Comparable as well?
On Sat, Dec 19, 2009 at 4:54 PM, Martin DeMello <martindemello@gmail.com>wrote:
[#27242] select! — Roger Pack <rogerdpack@...>
Forwarded from ruby-talk:
Hi,
[#27244] [Bug #2505] Threads behave inconsistently across platforms. — Christian Höltje <redmine@...>
Bug #2505: Threads behave inconsistently across platforms.
[#27256] [Feature #2509] Recursive freezing? — Marc-Andre Lafortune <redmine@...>
Feature #2509: Recursive freezing?
[#27270] rb_eql, rb_equal — Roger Pack <rogerdpack@...>
would it be more efficient to add an extra == in there for these
[#27275] [Bug #2511] irb exits unexpectedly windows — Vlad Why <redmine@...>
Bug #2511: irb exits unexpectedly windows
[#27286] [Bug #2515] Array#select! — Roger Pack <redmine@...>
Bug #2515: Array#select!
Issue #2515 has been updated by Marc-Andre Lafortune.
[#27304] Ruby 1.8: Improved Rational performance by 10% — Kurt Stephens <ks@...>
http://kurtstephens.com/node/105
On Thu, Dec 24, 2009 at 1:56 PM, Kurt Stephens <ks@kurtstephens.com> wrote:
[#27324] [Bug #2530] Future timestamps in 1.8.7-p248 generate recursive compilation process — Luis Lavena <redmine@...>
Bug #2530: Future timestamps in 1.8.7-p248 generate recursive compilation process
[#27360] [Feature #2542] URI lib should be updated to RFC 39886 — Marc-Andre Lafortune <redmine@...>
Feature #2542: URI lib should be updated to RFC 39886
Issue #2542 has been updated by Yui NARUSE.
[ruby-core:27323] Re: select!
Hi
2009/12/25 David A. Black <dblack@rubypal.com>
> Hi --
>
>
> On Thu, 24 Dec 2009, Gavin Sinclair wrote:
>
> On Thu, Dec 24, 2009 at 10:19 AM, David A. Black <dblack@rubypal.com>
>> wrote:
>>
>> |Is there any reason there's no select!
>>>>
>>>> Enumerables cannot have bang method, since they are not always
>>>> mutable. The reason we don't have Array#select! is that I feel the
>>>> word select means picking up elements, not removing non-selecting
>>>> elements. But I once felt same way to map! and (English speaking)
>>>> people persuaded me, so same thing could happen on select! as well.
>>>>
>>>
>>> I agree with you. The idea of a destructive select makes no sense to
>>> me. Selecting implies that there's a result set that's separate from
>>> the original collection.
>>>
>>
>> I think it's fine. It's an aggressive selection, like selecting a
>> sports team from a squad of available players.
>>
>
> But that's the thing; it's the original squad, not the selected team,
> that's analogous to the array.
>
> Say you've got a squad of players, standing in a line:
>
> SQUAD: Joe Jim Jill Jack Jason Jeff Joan
>
> You select a bunch of them for a team and ask them to step forward, on
> the understanding that they will no longer be part of the original
> squad/pool of players
>
> SQUAD: Joe Jill Jack Jeff
>
> TEAM : Jim Jason Joan
>
> The squad (i.e., the original "object" from which you have made a
> selection) now consists of the people who were *not* selected for the
> team, not those who were.
>
> Aggressiveness isn't relevant. If you say to Jim, Jason, and Joan:
> "You have been *aggressively* selected for the team!", that should
> still mean that they're on the team, not that they're back in the
> original player pool (the array/object), let alone that they are now
> the sole occupants of that original pool.
>
> Select and reject are not symmetrical or opposite operations; they're
> two names for the same process, namely identifying a result set based
> on selection criteria from a collection. However this process happens,
> you end up with the original collection and the result set. The only
> decision to be made is whether or not the members of the result set
> can also be in the original collection.
>
> A destructive reject means: having made this separation of original
> collection and result set, make the separation permanent. A
> destructive select, in the sense that's being suggested here, would
> mean: having made the separation, replace the original collection with
> the result set. That's a completely new twist, and one that isn't
> implied in any way by the original idea of "select".
>
> That's why "keep" makes more sense as a name for "reduce the original
> collection to the matching elements". It's a simple statement of the
> semantics of this particular operation.
>
> (I almost wish reject! were called "discard" or something. I think the
> similarity in sound between reject and select suggests a symmetry that
> really isn't in the semantics.)
>
>
>
> David
>
> --
> David A. Black
> Senior Developer, Cyrus Innovation Inc.
> THE COMPLEAT RUBYIST, Ruby training with Black/Brown/McAnally!
> January 22-23, Tampa, Florida
> Info and registration at http://www.thecompleatrubyist.com
>
I think also select is just taking a part of something and probably do
something with that part.
For the team (let's say of football), I see it in this way:
Somebody is going to select some people, for example:
people.select { |p| p.strength > 0.8 && p.cooperative? }
So, now you want to add these player to the team. But you'll have too many
players... So you need to reject some :
team.reject { |p| p.bad? }
So:
team.reject! { |p| p.bad? }
team += people.select { |p| p.strength > 0.8 && p.cooperative? }
About your example of select!:
result = collection.map { |x|
...
...
...
}
result.select! { |x| ... }
I think not many people use select to change a collection. Well, with this
select, what you'll gonna do is removing(rejecting...) some elements. And
that fact is linked to reject, not to select. Select is, as Matz said
earlier, done for picking up some elements and then do something with them.
But, show us some real use of select!, to see how it looks ;)
Also, I think this kinf of things:
irb(main):001:0> a = (1..6).to_a
=> [1, 2, 3, 4, 5, 6]
irb(main):002:0> a.map! { |n| -n }.reject! { |n| n.even? }
=> [-1, -3, -5]
Looks really not good and doing this seem more readable:
a = a.map { |n| -n }.reject { |n| n.even? }
Anyway, Happy Christmas's day