Hi,

Two points:

(1) Currently symbols and strings are very different in several
    aspect.  Making them "compatible" would break backward
    compatibility.

(2) "==" and "===" have different roles from PHP.  So your logic is
    incomplete.  I suggest to learn "Ruby Way", before proposing
    language changes to Ruby.

So in summary, this proposal is half-baked.  Need to be more concrete.

							matz.

In message "Re: [ruby-core:42509] [ruby-trunk - Feature #5964] Make Symbols an Alternate Syntax for Strings"
    on Mon, 13 Feb 2012 09:10:21 +0900, Tom Wardrop <tom / tomwardrop.com> writes:

|I do agree Kurt, though I still maintain that Ruby should be more forgiving when it comes to Strings and Symbols. It's not always clear whether something is "data" as you put it, or a pointer/concept to data. What makes this even less clear cut, is that data can become a concept at runtime. In the ideal world, it would be very obvious where to use a String and where to use a Symbol, but it is not in this world. I think at the least, Ruby should provide a simpler means to compare Strings and Symbols where the programmer doesn't care what type of string data hits their API. That should be the default. If you explicitly care about the type of String data you have received, then that should be the exception, and thus you should have to be perform a strict comparison.
|
|So in summary, String == Symbol should be by default I think. To do a strict comparison where you care about type, you should have to do a ===. That's one of the fews things I use to like about PHP. "==" was a lose comparison, "===" was a type-sensitive strict comparison, and it was consistent across the board.