[#7055] More on VC++ 2005 — Austin Ziegler <halostatue@...>

Okay. I've got Ruby compiling. I'm attempting to get everything in

17 messages 2006/01/05
[#7058] Re: More on VC++ 2005 — nobuyoshi nakada <nobuyoshi.nakada@...> 2006/01/06

Hi,

[#7084] mathn: ugly warnings — hadmut@... (Hadmut Danisch)

Hi,

22 messages 2006/01/10
[#7097] Re: mathn: ugly warnings — Daniel Berger <Daniel.Berger@...> 2006/01/10

Hadmut Danisch wrote:

[#7098] Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/10

Daniel Berger wrote:

[#7118] Re: Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/12

*Dean Wampler *<deanwampler gmail.com> writes:

[#7226] Fwd: Re: Question about massive API changes — "Sean E. Russell" <ser@...>

Hello,

23 messages 2006/01/28
[#7228] Re: Question about massive API changes — Caleb Tennis <caleb@...> 2006/01/28

>

Struct#select behavior vs rdoc

From: Ryan Davis <ryand-ruby@...>
Date: 2006-01-31 04:35:13 UTC
List: ruby-core #7254
% ri Struct#select
---------------------------------------------------------- Struct#select
      struct.select(fixnum, ... )   => array
      struct.select {|i| block }    => array
------------------------------------------------------------------------
      The first form returns an array containing the elements in  
_struct_
      corresponding to the given indices. The second form invokes the
      block passing in successive elements from _struct_, returning an
      array containing those elements for which the block returns a true
      value (equivalent to +Enumerable#select+).

         Lots = Struct.new(:a, :b, :c, :d, :e, :f)
         l = Lots.new(11, 22, 33, 44, 55, 66)
         l.select(1, 3, 5)               #=> [22, 44, 66]
-----
irb(main):001:0> st = Struct.new 'Foo', :a, :b
=> Struct::Foo
irb(main):002:0> s = st.new 'a', 'b'
=> #<struct Struct::Foo a="a", b="b">
irb(main):003:0> s.select 0
ArgumentError: wrong number of arguments (1 for 0)
-----
static VALUE
rb_struct_select(argc, argv, s)
// ...
     if (argc > 0) {
	rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
     }
-----

I assume this is intentional, may I update the rdoc to reflect this  
change?


In This Thread

Prev Next