From: mjl@... (Martin J. Laubach) Date: 2001-07-10T01:40:09+09:00 Subject: [ruby-talk:17546] Constants and Variables Hi there, I recently stumbled on ruby, and as a long time fan of Objective C found it immediately appealing. More than perl anyway, which is what I use for most projects nowaday. However, reading the language description and faq, there are some points that leave me flabbergasted as to why it is done this way, or which I really miss -- I'll throw them in the mailing list in the next few days and probably be roasted to a crisp in the ensuing flame fest :) The first point is the definition of constants (a symbol starting with an upper case letter) -- WTF was it done that way, mixing syntax and semantics, instead of having a "const" attribute. After all, if you go down that way, ruby could define protected methods as "starting with an underscore" or such. I'd rather have a const attribute which makes the object immutable. One of the other things I miss dearly is a way to create a new block-local variable. I have been bitten by foo = 42 bar.each { |foo| foo.doSomething(); } ...foo is no longer 42 which would have been avoided by defining the second foo as block local -- by the way, it is a formal parameter for the block, why does it even think about touching the foo from outside the block? This looks so wrong to me. Any insights? mjl