From: Bill Kelly Date: 2002-12-01T09:53:10+09:00 Subject: Re: Ruby Document Hi Shannon, > If :a is independent to any other variable, it can only be a > "immutable" or very economic string, what's the big deal? Yes, exactly. :a is not any kind of variable at all, nor is it bound to any kind of variable. It, indeed, is an immutable, economic, singleton construction of the string "a". What's the big deal? Well, ... does something have to be a Big Deal to be useful? :) I like symbols in Ruby a lot. Smalltalk has them (but my Smalltalk is rusty so I don't remember it there's a special syntax for them); and Java has them ( http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html#intern() ) but what I think is so fantastic in Ruby is the ability to specify a symbol syntactically without cluttering up the code. :name is so much nicer and easier to read than "name".intern... So with Ruby we can utilize symbols for certain kinds of constants, and, I think make the code very readable. @state = :login # . . . . . case @state when :login then session_handle_login(line) when :passwd then session_handle_passwd(line) when :shell then session_handle_shell(line) end So maybe no big deal, but, I think Ruby would be diminished if it didn't have symbols so syntactically convenient.. Regards, Bill