[#11439] comments needed for Random class — "NAKAMURA, Hiroshi" <nakahiro@...>

-----BEGIN PGP SIGNED MESSAGE-----

15 messages 2007/06/12

[#11450] Re: new method dispatch rule (matz' proposal) — David Flanagan <david@...>

This is a late response to the very long thread that started back in

17 messages 2007/06/13

[#11482] Ruby Changes Its Mind About Non-Word Characters — James Edward Gray II <james@...>

Does this look like a bug to anyone else?

10 messages 2007/06/16

[#11505] Question about the patchlevel release cycle — Sylvain Joyeux <sylvain.joyeux@...4x.org>

1.8.6 thread support was broken in bad ways. It stayed for three months

20 messages 2007/06/20
[#11512] Re: Question about the patchlevel release cycle — Urabe Shyouhei <shyouhei@...> 2007/06/20

Hi, I'm the 1.8.6 branch manager.

[#11543] Re: Apple reportedly to ship with ruby 1.8.6-p36 unless informed what to patch — James Edward Gray II <james@...>

On Jun 27, 2007, at 4:47 PM, Bill Kelly wrote:

10 messages 2007/06/27

Re: method_missing for Enumerator

From: Daniel DeLorme <dan-ml@...42.com>
Date: 2007-06-25 23:42:15 UTC
List: ruby-core #11539
TRANS wrote:
> But I take your point, I had tried using a separate class
> (Enumerable::Elementor), but it meant using a #to_elem (eg.
> [1,2,3].to_elem(:select) > 2) which largely killed the effect. Unless
> someone has better ideas for achieving R-like operations, adding
> method_missing to Enumerator seems like the best bet. I'll make it as
> an add-on library of Facets.

Maybe making it more explicit would remove a lot of the perceived 
danger, e.g.:

   class Enumerable::Enumerator
     def for
       enum = self.dup
       def enum.method_missing...
       enum
     end
   end
   [1,2,3].select.for > 2

or alternatively:

   class Enumerable::Enumerator
     def element
       Enumerable::Elementor(self)
     end
   end
   [1,2,3].select.element > 2

I think that's getting awfully close to higher order messaging though.


Daniel


In This Thread

Prev Next