[#17480] Array#fill behavior — "Vladimir Sizikov" <vsizikov@...>
Hi,
[#17488] HOME and USERPROFILE aliasing under Windows — "John Lam (IRONRUBY)" <jflam@...>
MRI currently expects the HOME environment variable to be set under Windows=
[#17491] [Ruby 1.8.7 - Bug #213] (Open) Different ERB behavior across versions — Federico Builes <redmine@...>
Issue #213 has been reported by Federico Builes.
[#17503] Possible misbehaviour in mkmf.rb package — S駻gio Durigan J佖ior <sergiodj@...>
Hello all,
On Wednesday 02 July 2008, S駻gio Durigan J佖ior wrote:
[#17509] YAML in Ruby — Trans <transfire@...>
Might we ever imagine a time when YAML is an integral part of Ruby?
[#17518] [Ruby 1.8 - Bug #216] (Open) Memory leaks in 1.8.6p230 and p238 — Igal Koshevoy <redmine@...>
Issue #216 has been reported by Igal Koshevoy.
[#17566] rubychecker - runs checks on a Ruby interpreter — Igal Koshevoy <igal@...>
I've put together a shell script that runs checks on a Ruby interpreter.
Why not write it in ruby?
Kurt Stephens wrote:
I've split up the code of rubychecker. One git repo has the GNU Bash
[#17574] rubyspec reports for ruby_1_8, ruby_1_8_7, and v1_8_6_p265 — Stephen Bannasch <stephen.bannasch@...>
I wanted to learn more about specs recently started using git and so
Stephen Bannasch wrote:
[#17595] Crashes and hangups on latest 1_8 branch — "Vladimir Sizikov" <vsizikov@...>
Hi,
[#17609] [PATCH] Fix Makefile update-rubyspec task — Gaston Ramos <ramos.gaston@...>
Hi, I'm trying to run rubyspec tests on 1.8 branch and get this error:
[#17615] [PATCH] ruby-mode.el: Fix here-doc strings with inner quotes — Nathan Weizenbaum <nex342@...>
At the moment, ruby-mode.el uses font-lock-keywords as opposed to
It was designed to fix the following case:
Here's a third patch that fixes a bug in the second and uses a quicker
One more patch which fixes a few bugs in the the last one.
Hi,
Looks like version 22 doesn't support explicitly numbered regexp groups.
Hi,
Hi,
Alright, here's a version that fixes both the highlighting bug and the
Hi,
Are you asking me? If so, go right ahead. Also, for posterity's sake,
One more bugfix.
Hi,
[#17627] ncurses-specific functions in ruby's curses — "Kirill A. Shutemov" <kirill@...>
Is it possible to add ncurses-specific functions to curses ruby module?
On Sunday 06 July 2008, Kirill A. Shutemov wrote:
On Mon, Jul 07, 2008 at 10:25:42AM +0200, Marc Haisenko wrote:
On Monday 07 July 2008, Kirill A. Shutemov wrote:
[#17629] Proper exception out of throw? — "Vladimir Sizikov" <vsizikov@...>
Hi,
[#17644] Features to be included in Ruby 1.9.1 — "Yugui (Yuki Sonoda)" <yugui@...>
Hi, all
Dave Thomas wrote:
There are two things I would like to see added to 1.9.1. A one-byte
Hi,
Hi,
In article <E1KGF2L-0000Qx-K5@x61.netlab.jp>,
Hi,
[#17674] [Ruby 1.8 - Bug #238] (Open) Ruby doesn't respect the Windows read-only flag — Jim Deville <redmine@...>
Issue #238 has been reported by Jim Deville.
[#17690] [Ruby 1.8 - Feature #249] (Open) wish list item: binding.set_local_variable — Roger Pack <redmine@...>
Issue #249 has been reported by Roger Pack.
[#17694] Mark functions not called on exit — Charlie Savage <cfis@...>
Hi everyone,
Hi,
[#17699] Omissions on the ruby-lang.org website and in redmine — "Austin Ziegler" <halostatue@...>
As far as I can tell, there's nowhere on the ruby-lang.org website
On Jul 9, 2008, at 8:05 AM, Austin Ziegler wrote:
On Jul 9, 2008, at 6:07 PM, Ryan Davis wrote:
On Wed, Jul 9, 2008 at 5:14 PM, James Gray <james@grayproductions.net> wrote:
[#17708] [Ruby 1.8 - Bug #252] (Open) Array#sort doesn't respect overridden <=> — Ryan Davis <redmine@...>
Issue #252 has been reported by Ryan Davis.
Issue #252 has been updated by Vladimir Sizikov.
Hi,
Nobuyoshi Nakada wrote:
[#17759] Ruby 1.9.1 Feature and 1.9.0-3 release plan — "Yugui (Yuki Sonoda)" <yugui@...>
Thank you for your replies to [ruby-core:17644]. < all
[#17785] [Ruby 1.9 - Bug #277] (Open) 1.9/trunk: build broken in ruby/ruby.h — Ollivier Robert <redmine@...>
Issue #277 has been reported by Ollivier Robert.
[#17812] Tracing versus coverage (was Re: Re: Features to be included in Ruby 1.9.1) — "Rocky Bernstein" <rocky.bernstein@...>
Sorry for not noticing sooner. It occurs to me that the built-in
It seems to me what you need is not a coverage system but a general hook
I just looked at the code to set the coverage hash and it seems to
Hi Rocky,
[#17822] rdoc defines Hash#method_missing — "Yusuke ENDOH" <mame@...>
Hi,
[#17829] FAILURE of "expand_path" — "C.E. Thornton" <admin@...>
Core,
C.E. Thornton wrote:
Urabe Shyouhei wrote:
On Sat, Jul 19, 2008 at 04:27:09AM +0900, C.E. Thornton wrote:
[#17833] Object allocation tracking — Christopher Thompson <cthompson@...>
Please excuse the blog spam.
[#17843] Exapand_path Patch good as stands. — "C.E. Thornton" <admin@...>
Core,
[#17865] Expand_Path: New Patch - Modified Processing — "C.E. Thornton" <admin@...>
Core,
Hi,
Hi,
[#17871] duping the NilClass — "Nasir Khan" <rubylearner@...>
While nil is an object, calling dup on it causes TypeError. This doesnt seem
Nasir Khan wrote:
On Sun, Jul 20, 2008 at 7:55 PM, Urabe Shyouhei <shyouhei@ruby-lang.org>
Meinrad Recheis wrote:
Urabe Shyouhei wrote:
I write a lot of hand crafted dup or clone because I want control as well as
Hi --
+1 to David. A convenient way to do Marshal idiom should be a new
On Mon, Jul 21, 2008 at 8:21 AM, Urabe Shyouhei <shyouhei@ruby-lang.org> wrote:
Hi --
On Mon, Jul 21, 2008 at 1:02 PM, David A. Black <dblack@rubypal.com> wrote:
Hi --
On Mon, Jul 21, 2008 at 5:18 PM, David A. Black <dblack@rubypal.com> wrote:
[#17883] [Ruby 1.9 - Bug #340] (Open) 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1) — Ollivier Robert <redmine@...>
Issue #340 has been reported by Ollivier Robert.
[#17915] select returning an enumerator — "David A. Black" <dblack@...>
Hi --
[#17922] [Ruby 1.9 - Bug #345] (Open) 1.9 racc appears to seg fault — Roger Pack <redmine@...>
Issue #345 has been reported by Roger Pack.
[#17943] RUBY_ENGINE? — "Vladimir Sizikov" <vsizikov@...>
Hi,
In article <3454c9680807241200xf7cc766qb987905a3987bb78@mail.gmail.com>,
On Thu, Jul 24, 2008 at 7:46 PM, Ryan Davis <ryand-ruby@zenspider.com> wrote:
Hi,
In article <3454c9680807250054i70db563duf44b42d92ba41bfb@mail.gmail.com>,
On Sat, Jul 26, 2008 at 5:09 AM, Tanaka Akira <akr@fsij.org> wrote:
Hi,
Since this thread seemed to die out, I'll ask again:
Hi,
Hi all.
Hi,
Yukihiro Matsumoto wrote:
[#17954] Expand_path -- Proposal: An alternate method — "C.E. Thornton" <admin@...>
HI,
Hi,
Yukihiro Matsumoto wrote:
[#17973] Proposal of GC::Profiler — Narihiro Nakamura <authorNari@...>
Hi.
On Fri, 2008-07-25 at 23:59 +0900, Narihiro Nakamura wrote:
[#18016] Re: Hex string literals [Patch] — gdefty@...
Before posting the message below I thought long
[#18029] [Ruby 1.9 - Bug #378] (Open) rbconfig.rb:173: [BUG] Stack consistency error — Anonymous <redmine@...>
Issue #378 has been reported by Anonymous.
[#18033] JRuby adding ConcurrencyError for fatal concurrent modification — Charles Oliver Nutter <charles.nutter@...>
In order to limit or reduce the likelihood that multiple threads
Hi,
Yukihiro Matsumoto wrote:
[ruby-core:17919] Re: select returning an enumerator
Hi --
On Wed, 23 Jul 2008, David Flanagan wrote:
> David A. Black wrote:
>> Hi --
>>
>> I notice that select without a block returns an enumerator in 1.9. I'm
>> wonder if there's any use case for this -- in other words, any reason
>> you would ever do this:
>>
>> array.select.some_method
>>
>> Also, it means that you get an enumerator instead of an error message
>> if you do (presumably by accident) this:
>>
>>>> a = [1,2,3,4,5]
>> => [1, 2, 3, 4, 5]
>>>> puts a.select do |x| x > 3 end
>> #<Enumerable::Enumerator:0x3b7fcc>
>>
>> I know that something similar will happen with map and others, but if
>> there's no real reason to get an enumerator, I'd prefer that select
>> complained about not having a block.
>>
>>
>> David
>>
>
> David,
>
> I'm sure you've played around with this enough to realize that the enumerator
> returned by a.select somehow (and I don't really get the magic that is going
> on) retains its selection semantics. So:
>
> a = [1,2,3,4,5]
> e = a.select
> e.each { |x| x %2 == 1} # => [1,3,5]
>
> I know that that is not a convincing use-case. But begin able to create an
> enumerator that does selection allows us to chain enumerators:
>
> a.select.with_index { |x,i| x%2 == 1 and i >= 2 } # => [3,5]
>
> This, I think, is a pretty convincing reason for select to return an
> Enumerator.
You're right that I knew that, though I hadn't factored it in,
so you're even more right to remind me :-)
But I'm not sure it's enough of a reason. For one thing, I can't seem
to think of any case other than with_index where chaining select to
anything makes sense. I believe that's because with_index is one of
the few methods that Enumerators have that don't come from Enumerable,
so it's designed to be sort of additive, whereas most of the others
just plain "win":
a.select.map # might as well be a.map
a.select.inject # might as well be a.inject
etc.
(though inject without a block still blows up.)
Here's a weird one for you (not inconsistent or anything, but I've
found it striking):
>> h = {1=>2, 3=>4, 5=>6}
=> {1=>2, 3=>4, 5=>6}
>> h.select {|k,v| k > 2 }
=> {3=>4, 5=>6}
>> e = h.select
=> #<Enumerable::Enumerator:0x3cae24>
>> e.each {|k,v| k > 2 } # like your example
=> {3=>4, 5=>6}
>> e.select {|k,v| k > 2 }
=> [[3, 4], [5, 6]]
The e.select returning an array is because e's select is
Enumerable#select, not Hash#select. It's a kind of un-overriding: Hash
overrides select; the enumerator hooks its each to Hash#select; the
enumerator's select reverts to Enumerable#select, sans override.
I can see what's going on but it still looks quite odd. It's a
reminder that enumerators are not proxies but parasites.
Here's another one:
>> a = [1,2,3,4,5]
=> [1, 2, 3, 4, 5]
>> e = a.reject!
=> #<Enumerable::Enumerator:0x395a58>
>> e.each {|b| b > 3 }
=> [1, 2, 3]
>> a
=> [1, 2, 3]
Again, explicable, but kind of weird (to me).
> On the other hand, I suspect there are other iterators for which it is harder
> to create a convincing use-case.
And the only "penalty" for caring about your block is that someone has
to call to_enum on you. In other words, if select cared about a block,
you could still do this:
e = a.to_enum(:select)
instead of
e = a.select
I'm probably being regressive, but (leaving aside the question of how
much of either one would do anyway) I like the first one better.
> I've you've looked at the C code for the
> iterators, you know that all it takes to make an iterator (implemented in C)
> return an Enumerator when no block is passed is to insert a single macro
> call. My recollection is that these macros were inserted into the core
> iterators very quickly in the fall of 2007. The ease with which the change
> was made makes me wonder if the use case for each iterator was thought
> through or if it was more a case of ease and consistency: might as well make
> all iterators return Enumerators because it is easy and most of them do.
The only one I can find, on spot-checking, that doesn't return either
an enumerator or a useful value (like zip) is inject. I don't know why
it still cares about having a block.
David
--
Rails training from David A. Black and Ruby Power and Light:
Intro to Ruby on Rails July 21-24 Edison, NJ
* Advancing With Rails August 18-21 Edison, NJ
* Co-taught by D.A. Black and Erik Kastner
See http://www.rubypal.com for details and updates!