This is the old RCRchive. It's available only for
reading and reference. To submit RCRs for Ruby 1.9/2.0, and to participate
in discussions about them, please visit
the new RCRchive.
RCR 351: More compatibility between Array and Set
Submitted by CyberGarp
(Tue Oct 31 02:41:11 UTC 2006)
Abstract
A simple request, the add method in Set would be nice to have in Array.
Problem
I have some areas where Set and Array need to be used interchangeably for storage as unique or non-unique values. Having an add for both of these make the syntax of later usage the same via duck-typing.
Proposal
class Array will now have a method add, analogous to push.
Analysis
No impact on existing applications.
Implementation
class Array
alias add push
end
|
|
| Strongly opposed | 0 |
| Opposed | 0 |
| Neutral | 0 |
| In favor | 0 |
| Strongly advocate | 0 |
|
RCRchive copyright © David Alan Black, 2003-2005.
Powered by Ruby on Rails.