/* * call-seq: * enum.any? [{|obj| block } ] => true or false * * Passes each element of the collection to the given block. The method * returns <code>true</code> if the block ever returns a value other * than <code>false</code> or <code>nil</code>. If the block is not * given, Ruby adds an implicit block of <code>{|obj| obj}</code> (that * is <code>any?</code> will return <code>true</code> if at least one * of the collection members is not <code>false</code> or * <code>nil</code>. * * %w{ ant bear cat}.any? {|word| word.length >= 3} #=> true * %w{ ant bear cat}.any? {|word| word.length >= 4} #=> true * [ nil, true, 99 ].any? #=> true * */ static VALUE enum_any(obj) VALUE obj; { VALUE result = Qfalse; rb_iterate(rb_each, obj, rb_block_given_p() ? any_iter_i : any_i, (VALUE)&result); return result; }