--MfFXiAuoTsnnDAfZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Apr 14, 2012 at 10:58:12AM +0900, mame (Yusuke Endoh) wrote:
> 
> Issue #6293 has been updated by mame (Yusuke Endoh).
> 
> Status changed from Open to Assigned
> Assignee set to matz (Yukihiro Matsumoto)
> 
> Hello,
> 
> 2012/4/14 tenderlovemaking (Aaron Patterson) <aaron / tenderlovemaking.com>:
> > I'd like to add new Queue objects to ruby.
> 
> I bet matz does not accept it because there is no good reason.
> Why don't you extend the traditional Queue class?

I could, but I think the changes I want would add too much complexity
to the traditional Queue class.  We have to add branching code for every
method that could block / not-block.  Not to mention users must pass the
magical true | false to indicate if they want blocking or non-blocking
behavior.  For example:

  queue.pop(true)  # does "true" mean I enable blocking?
  queue.pop(false) # does "false" mean I disable blocking?

It seems confusing to me, especially given the *actual* api with twists
your brain with a double negative (from thread.rb):

  def pop(non_block=false)
    ...
  end

So calling pop() means we're doing a not not blocking call. :(

> > * include Enumerable
> 
> The semantics is not trivial.  See the discussion in #4589.

I've read #4589.  I don't think it's that much of a problem.  Other
languages[1] include enumerable type behavior in their queues, and
consistency is not guaranteed.

1.  http://docs.oracle.com/javase/6/docs/api/java/util/Queue.html#methods_inherited_from_class_java.util.Collection

-- 
Aaron Patterson
http://tenderlovemaking.com/

--MfFXiAuoTsnnDAfZ
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)

iQEcBAEBAgAGBQJPiOAFAAoJEJUxcLy0/6/GjcUH/3ey4of2ybgSd16/49kF39bY
G+PYFMIPjZ7WizSjtaY0T3CZxxNzPelP+FsIySpujPN4LlKDDmqQNmuq6d2MN30T
/BnwoTXNVLATj1VnJBBiy16x1XpP90fFW7J4kdrdyMvPR0m+KIPxnea7rfv7r4Yr
e3Pmtdg4dShNBcJIH4UINgBtOKlVKcb0yu8gVa75LJQBYtxhLWHSTIkTNvHsk076
ztNNDa3XgmeFpVb3qze7bvA/B4E5TLC37NtIvSmyvoVk9+sTIwamJvsPzEhVRON5
L/ss1Pz7BNAxmLYG9GlbUcBjXDcOcBN3YmrUrwPtgOD9XzQH5lJnbRGXKtk6vVsKY
-----END PGP SIGNATURE-----

--MfFXiAuoTsnnDAfZ--