ruby picture

RCR 238: Remove set methods from Array

Submitted by kgergely (Thu Apr 01 09:04:42 UTC 2004)

Abstract

In the current implementation arrays and sets are mixed, there are some methods, which should exist in Sets, not in Arrays

Problem

Don't mix these two things.

Proposal

Remove the following (two) methods: & |

Analysis

This should force the use of Sets if neccecary, code breaks, but helps new programmers not to mix arrays with sets. (Look at php and arrays and hashes...)

Implementation

ruby picture
Comments Current voting

What do you mean by "separate Arrays and sets"?

I have no idea what change to Array class you are proposing. RCR should be concrete. Please re-submit the RCR, if you propose something seriously.

--matz.


Basically, the removal of Array#& and Array#| is being recommended to enforce the use of Set for those things. I am opposed to the suggestion as it stands, even though I don't currently use Array#& and Array#|. I really don't know what value it provides to enforce the use of Set as opposed To Array, and this appears to be what is really missing from the RCR. The suggestion is "conceptually" clean, but aside from conceptual cleanliness, I don't see an upside here. -- Austin Ziegler


Strongly opposed 1
Opposed 8
Neutral 1
In favor 0
Strongly advocate 0
ruby picture
If you have registered at RCRchive, you may now sign in below. If you have not registered, you may sign up for a username and password. Registering enables you to submit new RCRs, and vote and leave comments on existing RCRs.
Your username:
Your password:

ruby picture

Powered by .