[#6363] Re: rescue clause affecting IO loop behavior — ts <decoux@...>

>>>>> "D" == David Alan Black <dblack@candle.superlink.net> writes:

17 messages 2000/11/14
[#6367] Re: rescue clause affecting IO loop behavior — David Alan Black <dblack@...> 2000/11/14

Hello again --

[#6582] best way to interleaf arrays? — David Alan Black <dblack@...>

Hello --

15 messages 2000/11/26

[#6646] RE: Array Intersect (&) question — Aleksi Niemel<aleksi.niemela@...>

Ross asked something about widely known and largely ignored language (on

23 messages 2000/11/29
[#6652] RE: Array Intersect (&) question — rpmohn@... (Ross Mohn) 2000/11/29

aleksi.niemela@cinnober.com (Aleksi Niemel) wrote in

[#6723] Re: Array Intersect (&) question — Mathieu Bouchard <matju@...> 2000/12/01

> >Use a hash. Here's code to do both and more. It assumes that

[#6656] printing/accessing arrays and hashes — raja@... (Raja S.)

I'm coming to Ruby with a Python & Common Lisp background.

24 messages 2000/11/30

[ruby-talk:6655] Re: rescue clause affecting IO loop behavior

From: "Conrad Schneiker" <schneik@...>
Date: 2000-11-30 00:18:27 UTC
List: ruby-talk #6655
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.)

In This Thread

Prev Next