Cullen J O'Neill writes: # David Alan Black (dblack / candle.superlink.net) wrote: # > Maybe it's just because I was not expecting the current behavior, and # > therefore saw it in a somewhat negative light when I discovered it... # > but I tend to think that a begin/end block should behave the same way, # > with regard to its modifiers, whether it contains a rescue clause or # > not. Or, if an exception-handling begin/end block is really a # > different thing from a regular begin/end block, then perhaps the # > modifiers should be illegal. The thing that is confusing, in my view, # > is to allow the modifiers but not have the whole thing behave in the # > expected "expression-modifier-boolean" way. # # I agree with this, except when it comes to the word 'illegal'. Too many # programs have probably been written that MAY have used it. And nobody # wants to upgrade if half their stuff will break. <...> # If it could be officially disparaged and a warning could be issued when # it is encountered by ruby (which could be turned off with a no warnings # command line switch) I think that would be good. <...> # Is there a mechanism already in place for disparaged language features? # If not, shouldn't there be? I think you probably want to get such warnings only when explicitly requested (-w) so that applications don't start issuing these things to unsuspecting users/customers following Ruby upgrades. It would also be useful if such a mechanism worked with a "code check only" mode, so that information-gathering runs against the RAA and so on could be made, so as to estimate the impact of widely desired changes that are not completely backwards compatible. # While we're on the topic of things that bother me, <G> # The construct: # # unless (COND) # # do thing 1 # else # # do thing 2 # end # # is such a brain twister, it seems unecessary. I don't know, maybe I'll # get used to it (but I doubt it). Meanwhile, you could read "else" as "[you should] otherwise do" to make it read somewhat more naturally. # I think using else with unless should also be disparaged. I like unless better than if (! ...), and I'd want to preserve the option of adding else (something ...) for [hypothetically speaking] quickly patching the production code of others, when you want to minimize chances for errors in rewriting or want to minimize diff output. JMHO. Conrad Schneiker (This note is unofficial and subject to improvement without notice.)