[ruby-cvs:72013] nobu:r64921 (trunk): Add difference method to Array

nobu at ruby-lang.org nobu at ruby-lang.org
Fri Oct 5 15:23:34 JST 2018


nobu	2018-10-05 15:23:34 +0900 (Fri, 05 Oct 2018)

  New Revision: 64921

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64921

  Log:
    Add difference method to Array
    
    I introduce a `difference` method equivalent to the `-` operator, but
    which accept more than array as argument. This improved readability, and
    it is also coherent with the `+` operator, which has a similar `concat`
    method. The method doesn't modify the original object and return a new
    object instead. I plan to introduce a `difference!` method as well.
    
    Tests and documentation are included.
    
    It solves partially https://bugs.ruby-lang.org/issues/14097
    
    From: Ana Mar?\195?\173a Mart?\195?\173nez G?\195?\179mez <ammartinez at suse.de>

  Modified files:
    trunk/NEWS
    trunk/array.c
    trunk/test/ruby/test_array.rb


More information about the ruby-cvs mailing list