ruby-dev suumary 26862-26956

  • Thread starter Masayoshi Takahashi
  • Start date
M

Masayoshi Takahashi

Hi all,

This is a summary of ruby-dev ML in these days.


[ruby-dev:26869] [Oniguruma] Version 3.8.9

K.Kosako announced that new Oniguruma was released.


[ruby-dev:26881] Re: Failure: test_block_passing(TestIterator)

Kazuhiro NISHIYAMA reported that test_block_passing(TestIterator)
on ruby chkbuild (automated build test) fails in 1.8 and 1.9.

http://www.rubyist.net/~akr/chkbuild/debian-sarge/ruby-1.8/last
http://www.rubyist.net/~akr/chkbuild/debian-sarge/ruby-trunk/last

Nobuyoshi Nakada said that he was still considering.


[ruby-dev:26895] Enumerable#count

Satoru Takabayashi wrote a table of methods of Array
in Ruby, Python, JavaScript, Perl and C.

http://namazu.org/~satoru/blog/archives/000043.html

When he wrote it, he found that Ruby doesn't have
a method such as a.count(x) in Python. He wanted
to add Enumerable#count into Ruby.

But in his next mail, he found that Enumerable#nitems
has block like a.nitems{|e| e == x}. He guessed it
may be enough to do.


[ruby-dev:26900] multiplying empty string

Nobuyoshi Nakada asked whether it is a feature that
"x".taint * 0 is tainted when "x" is tainted. Matz
answered that it is by design and it should be not
problem, but Tanaka Akira doubted it (he is really
interested in taint model and its security).


[ruby-dev:26924] enumerator

Nobuyoshi Nakada made a patch to return Enumerator
object when Enumerable method is called without
block. It's applied to each or each-like methods
in Array, Dir, Hash, IO, Range, String and Struct.

http://www.rubyist.net/~nobu/ruby/enumerator.diff


Regards,

Masayoshi 'Maki' Takahashi E-mail: (e-mail address removed)
 
A

Austin Ziegler

[ruby-dev:26895] Enumerable#count
=20
Satoru Takabayashi wrote a table of methods of Array
in Ruby, Python, JavaScript, Perl and C.
=20
http://namazu.org/~satoru/blog/archives/000043.html
=20
When he wrote it, he found that Ruby doesn't have
a method such as a.count(x) in Python. He wanted
to add Enumerable#count into Ruby.
=20
But in his next mail, he found that Enumerable#nitems
has block like a.nitems{|e| e =3D=3D x}. He guessed it
may be enough to do.

I think that it would not be a bad idea to add Enumerable#count as an
alias for Enumerable#nitems, as while #nitems is somewhat sensible, it
doesn't leap out as a "count items that are like this" method to me. I
would tend to favour #select with #size or #inject if said method does
not exist.
[ruby-dev:26924] enumerator
Nobuyoshi Nakada made a patch to return Enumerator
object when Enumerable method is called without
block. It's applied to each or each-like methods
in Array, Dir, Hash, IO, Range, String and Struct.
=20
http://www.rubyist.net/~nobu/ruby/enumerator.diff

Um. Any chance of seeing this in Ruby 1.8.x? I'm supposing this is
instead of a LocalJumpError.

-austin
--=20
Austin Ziegler * (e-mail address removed)
* Alternate: (e-mail address removed)
 
F

Florian Groß

Austin said:
I think that it would not be a bad idea to add Enumerable#count as an
alias for Enumerable#nitems, as while #nitems is somewhat sensible, it
doesn't leap out as a "count items that are like this" method to me. I
would tend to favour #select with #size or #inject if said method does
not exist.

Why not? I read it as "number of items" so being able to use a block
seems natural.

#count might still be a good idea, though -- I think people are going to
try #count first.
 
N

nobu.nokada

Hi,

At Fri, 16 Sep 2005 02:38:30 +0900,
Austin Ziegler wrote in [ruby-talk:156292]:
[ruby-dev:26924] enumerator
Nobuyoshi Nakada made a patch to return Enumerator
object when Enumerable method is called without
block. It's applied to each or each-like methods
in Array, Dir, Hash, IO, Range, String and Struct.

http://www.rubyist.net/~nobu/ruby/enumerator.diff

Um. Any chance of seeing this in Ruby 1.8.x? I'm supposing this is
instead of a LocalJumpError.

It would be radical change for stable version, at least 1.8.3.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top