[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

A Syntax question..

Sonny Chee

4/4/2007 6:02:00 PM

Hey Guys,

I would have thought the following two code snippets were equivalent.
However, only the first one will raise err. Can someone explain to me
how I should be 'reading' the 2nd snippet?


rescue Exception => err
begin
RDoc::usage
rescue SystemExit
end
raise err


rescue Exception => err
begin RDoc::usage rescue SystemExit end
raise err


Sonny.

--
Posted via http://www.ruby-....

9 Answers

Dale Martenson

4/4/2007 7:34:00 PM

0

On Apr 4, 1:01 pm, Sonny Chee <sonny.c...@gmail.com> wrote:
> Hey Guys,
>
> I would have thought the following two code snippets were equivalent.
> However, only the first one will raise err. Can someone explain to me
> how I should be 'reading' the 2nd snippet?
>
> rescue Exception => err
> begin
> RDoc::usage
> rescue SystemExit
> end
> raise err
>
> rescue Exception => err
> begin RDoc::usage rescue SystemExit end
> raise err
>
> Sonny.
>
> --
> Posted viahttp://www.ruby-....

This may be wrong, but this works:

begin
raise err
rescue Exception => err
begin
puts "bummer 1"
raise err2
rescue Exception => err2
puts "bummer 1.1"
end
end

..vs.

begin
raise err
rescue Exception => err
begin puts "bummer 2"; raise err2; rescue Exception =>err2; puts
"bummer 2.1"; end
end

Sonny Chee

4/4/2007 7:44:00 PM

0

Thanks Dale. I'm not actually looking for a workaround. Snippet #1 of
my original post does work. I'm trying to understand why snippet #2
doesn't.

The only difference between the two are the whitespaces. If someone
could help me understand how snippet #2 is being parsed/read by the
interpretter that would be super.

--
Posted via http://www.ruby-....

Brian Candler

4/4/2007 9:19:00 PM

0

On Thu, Apr 05, 2007 at 03:01:56AM +0900, Sonny Chee wrote:
> Hey Guys,
>
> I would have thought the following two code snippets were equivalent.
> However, only the first one will raise err. Can someone explain to me
> how I should be 'reading' the 2nd snippet?
>
>
> rescue Exception => err
> begin
> RDoc::usage
> rescue SystemExit
> end
> raise err
>
>
> rescue Exception => err
> begin RDoc::usage rescue SystemExit end
> raise err

These are two different syntactic constructions.

<expression1> rescue <expression2>

returns the value of <expression1>, unless there is an exception in which
case it returns the value of <expression2>

In this construct, you cannot specify the exception class. I think it only
catches StandardError and subclasses.

Typical usage:

foo rescue nil # just ignore StandardError

a = foo rescue bar rescue baz # return value from foo, if exception
# then bar, if exception then baz

Regards,

Brian.

Sonny Chee

4/4/2007 9:23:00 PM

0

Awesome. That clarifies things. Thanks Brian.

--
Posted via http://www.ruby-....

All-Seeing-|

4/19/2011 11:52:00 PM

0

On Apr 19, 6:00 pm, Free Lunch <lu...@nofreelunch.us> wrote:
> On Tue, 19 Apr 2011 15:44:28 -0700 (PDT), AllSeeing-I
> <allseei...@usa.com> wrote in alt.talk.creationism:
>
>
>
>
>
> >On Apr 19, 5:37 pm, us4z...@att.net wrote:
> >> On Tue, 19 Apr 2011 14:32:44 -0700, John Locke <johnlocke...@comcast.net> wrote:
> >> >On Mon, 18 Apr 2011 22:47:43 -0700 (PDT), AllSeeing-I
> >> ><allseei...@usa.com> wrote:
>
> >> >>Some websites scoff at the apparent inconsistencies in the Bible. Yet
> >> >>these inconsistencies are usually not real inconsistencies, they are
> >> >>imaginary. For instance, the difference between Matthew's version of
> >> >>Judas' death and Luke's version is different. This is quite a blunder,
> >> >>eh? How can the bible be trusted with such glaring disparities?
>
> >> >..easy, it can't.
>
> >> Being the #1 all time Best Selling Book ever..... says it can.
>
> >> --------------------------THE TEN BESTSELLING BOOKS OF ALL-TIME--------------------------
> >> Rank   Author                  Book                                             Appx Sales
> >> 1       Various              The Holy Bible                            More than 6 Billion
> >> 2      Mao Tse-Tung     Quotations from Chairman Mao           900,000,000
> >> 3           Noah Webster        The American Spelling Book              Up to 100,000,000
> >> 4           Mark C. Young       Guiness Book of World Records         More than 90,000,000
> >> 5           World Almanac Editors       World Almanac                    73,500,000
> >> 6      William Holmes McGuffey  The McGuffey Readers          60,000,000
> >> 7      Benjamin Spock   The Common Sense Book of Baby and Child Care  More than 50,000,000
> >> 8           Elbert Hubbard      A Message to Garcia                 More than 40,000,000
> >> 9      Charles Monroe Sheldon   In His Steps, What Would Jesus Do? More than 30.000,000
> >> 10         Jacqueline Susann    Valley of the Dolls                  More than 30,000,000
>
> >>http://home.comcast.net/~antaylor1/bestselling...
>
> >> US4Zion
>
> >and it will remain the most printed, and read, book in history.
>
> >Nothing short of devine intervention, thats for sure.
>
> Nothing about this shows that the Bible is anything but an amazingly
> successful con.
>
> Remember that Islam is outgrowing Christianity. Does that prove that God
> likes Islam better?

No.

Unfortunately it may mean that Christianity has become less then a
perfect religion over the years. God is known to withdraw his grace
when a people turn away from him.

Like it of not, most Christians do not know their faith, nor do they
practice it everyday.

Some of them even fall prey to the lies you preach and actually begin
to believe that God used evolution to create.

.

Free Lunch

4/19/2011 11:57:00 PM

0

On Tue, 19 Apr 2011 16:51:47 -0700 (PDT), AllSeeing-I
<allseeingi@usa.com> wrote in alt.talk.creationism:

>On Apr 19, 6:00?pm, Free Lunch <lu...@nofreelunch.us> wrote:
>> On Tue, 19 Apr 2011 15:44:28 -0700 (PDT), AllSeeing-I
>> <allseei...@usa.com> wrote in alt.talk.creationism:
>>
>>
>>
>>
>>
>> >On Apr 19, 5:37?pm, us4z...@att.net wrote:
>> >> On Tue, 19 Apr 2011 14:32:44 -0700, John Locke <johnlocke...@comcast.net> wrote:
>> >> >On Mon, 18 Apr 2011 22:47:43 -0700 (PDT), AllSeeing-I
>> >> ><allseei...@usa.com> wrote:
>>
>> >> >>Some websites scoff at the apparent inconsistencies in the Bible. Yet
>> >> >>these inconsistencies are usually not real inconsistencies, they are
>> >> >>imaginary. For instance, the difference between Matthew's version of
>> >> >>Judas' death and Luke's version is different. This is quite a blunder,
>> >> >>eh? How can the bible be trusted with such glaring disparities?
>>
>> >> >..easy, it can't.
>>
>> >> Being the #1 all time Best Selling Book ever..... says it can.
>>
>> >> --------------------------THE TEN BESTSELLING BOOKS OF ALL-TIME--------------------------
>> >> Rank ? Author ? ? ? ? ? ? ? ? ?Book ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Appx Sales
>> >> 1 ? ? ? Various ? ? ? ? ? ? ?The Holy Bible ? ? ? ? ? ? ? ? ? ? ? ? ? ?More than 6 Billion
>> >> 2 ? ? ?Mao Tse-Tung ? ? Quotations from Chairman Mao ? ? ? ? ? 900,000,000
>> >> 3 ? ? ? ? ? Noah Webster ? ? ? ?The American Spelling Book ? ? ? ? ? ? ?Up to 100,000,000
>> >> 4 ? ? ? ? ? Mark C. Young ? ? ? Guiness Book of World Records ? ? ? ? More than 90,000,000
>> >> 5 ? ? ? ? ? World Almanac Editors ? ? ? World Almanac ? ? ? ? ? ? ? ? ? ?73,500,000
>> >> 6 ? ? ?William Holmes McGuffey ?The McGuffey Readers ? ? ? ? ?60,000,000
>> >> 7 ? ? ?Benjamin Spock ? The Common Sense Book of Baby and Child Care ?More than 50,000,000
>> >> 8 ? ? ? ? ? Elbert Hubbard ? ? ?A Message to Garcia ? ? ? ? ? ? ? ? More than 40,000,000
>> >> 9 ? ? ?Charles Monroe Sheldon ? In His Steps, What Would Jesus Do? More than 30.000,000
>> >> 10 ? ? ? ? Jacqueline Susann ? ?Valley of the Dolls ? ? ? ? ? ? ? ? ?More than 30,000,000
>>
>> >>http://home.comcast.net/~antaylor1/bestselling...
>>
>> >> US4Zion
>>
>> >and it will remain the most printed, and read, book in history.
>>
>> >Nothing short of devine intervention, thats for sure.
>>
>> Nothing about this shows that the Bible is anything but an amazingly
>> successful con.
>>
>> Remember that Islam is outgrowing Christianity. Does that prove that God
>> likes Islam better?
>
>No.

Once again, we have your completely unsubstantiated word to rely on.

>Unfortunately it may mean that Christianity has become less then a
>perfect religion over the years. God is known to withdraw his grace
>when a people turn away from him.
>
>Like it of not, most Christians do not know their faith, nor do they
>practice it everyday.
>
>Some of them even fall prey to the lies you preach and actually begin
>to believe that God used evolution to create.

Why would I ever believe anything you tell us? You refuse to learn. You
have no problem repeating falsehoods. You refuse to correct yourself.
You cheerfully spread foolishness. How could you possibly be
representing any gods?

All-Seeing-|

4/23/2011 7:07:00 PM

0

On Apr 19, 7:44 pm, Kadaitcha Man <no-brained.curl-
pated.ruff...@legless.putified.core> wrote:
> AllSeeing-I, Ye are a fetid slander of thy heavy mother's womb, a
> putrid scut, a noxious proud traitor, a reeky pervert, away, ye
> unemployed recreant and most degenerate traitor. Ye blew out:
>
> > Unfortunately it may mean that Christianity has become less then a
> > perfect religion over the years.
>
> That's contentious.

Of course.

> There is no evidence in the bible, that I am aware of, that Jesus set
> out to create a new religion. In this sense then the entire basis of
> Christianity as a religion is questionable at best; Christianity must
> necessarily be a man-made religion, like all other religions.

We agree on some level. Jesus never once stated he came to start a
religion. He came to save Abraham's family, the Hebrews. Nothing
illustrates this better then the story about the Faith of the
Canaanite Woman in which Jesus refers to all non-Jews as dogs,
[matt15.21] which was a common thing for the Jews to do back then.
Anyone that was not Jewish was referred to as a dog. Is it a wonder
why there is so much animosity between Arab and Jew today? Now, to be
fair about this, the Jews may have a good reason for using such a
term. But that is an altogether different subject and best left for
latter discussions.

It seems as though the bible is one long series of the Hebrews falling
out of grace with God only to have a hero rise up from among them to
show them the error of their ways. Deborah, Sampson, etc. There were
many of them. Jesus was another hero to rise among them but was
rejected instead. This is a pivotal point that is also a secondary
conversation. Suffice to say this key element could mean he is exactly
who he said he was.

Nevertheless, religion per se is in fact, nothing more then a man made
endeavor. It is riddled with man made rules and man made precepts that
are not from God. This is also a subject that was dear to Jesus and
further illustrates that he did not come to start a religion. Quite
the contrary. Simply put, he despised the religious leaders of his day
because they placed their personal and made up laws before God's
laws.

> In support of that latter point:
> If one of the claims of the New Testament is assumed to be true, viz
> faith alone (ignoring the wholly contradictory Pauline bits about the
> place of good works), then no religion is necessary. Furthermore,
> neither is the NT necessary; the only role of the NT is merely to tell a
> certain story that one ought to consider putting their faith in.

Right. For the early Christians this is the way it was. Constantine
had a revelation, which got the whole idea of Christianity as a major
national religion ball rolling. However, Paul did his part to bring
the good news to the gentiles.

The "good news" is what Jesus stressed. He wanted nothing else but to
teach the good news.

Anyone that can garner a full and complete understanding of this good
news will have a life changing experience.

> Following on from that, if another claim of the NT is assumed true, viz
> Christ was God as man (implicitly assumes Jesus was a real person), then
> imperfection must necessarily have set in the very first time the events
> around Jesus were witnessed first hand by observers of and actors in the
> actual events themselves. This is true because humans have less than
> perfect recall and are prone to embellishment, either deliberate or
> completely unintentional; humans also do not have direct access to any
> external 'real' world at all, therefore natural biases, embellishments
> and distortions of fact cannot possibly be avoided.

Yeah. However, the main points are consistent. Which in and of itself
leads creditability and truthfulness.

> Imperfection must necessarily have been further entrenched when the
> story was first written down, and it must necessarily have been fixed
> permanently in place when translations were undertaken, and imperfection
> is further sustained today by interpretation - witness the very large
> number of different Christian congregations and sects.
>
> Logically then, Christianity, if it were ever intended as a religion in
> the first place, cannot ever have been perfect in any way whatsoever.
> That applies even if another claim is assumed as true, viz the bible is
> the revealed word of God as given to and written down by men who were
> inspired by God.
>
> So then, this story that one ought to put their faith in cannot possibly
> be about believing in a God and the sacrifice that was purportedly made,
> and eternal damnation if you don't believe it. It can only be about
> nothing other than leading one's life in same the way Jesus is recorded
> as having lived his life.

Right. He is the Sheppard; we are to follow his example. However, this
does not negate the fact that he was divine. The textual evidence says
there was a virgin womb on one end of his existence and an empty tomb
on the other. That is quite a compelling detail for him being
supernatural. Add to this the miracles, the healings, and him
reappearing to his disciples after his death, and the reader can
assume this man was not actually a man even though he was appearing
before everyone as one.

The only thing left to do not is to decide whether or not the texts
are wrong, made up, or nothing more then lies.

The likelihood of that is slim.


> If what I say has any credence, right or wrong, then the claims of
> atheists about religion, Christianity in particular, have been
> substantiated. Necessarily then one must separate the man-made religion
> out from the intent of Christianity if one is going to discuss the NT
> with atheists.

This will not work because they cannot differentiate between God and
religion. To them they are one in the same. God knows I have tried to
explain the difference. It falls on deft ears.

>By that I mean to imply it is highly doubtful that any
> reasonable-minded atheist would disagree that Jesus' life is a suitable
> model for right-thinking people to emulate.

Sure. IMHO many atheist make better Christians then the ones that pray
on the street corners and tell everyone what a good christian they
are, which is also something Jesus addressed.

> To put all that in a slightly different perspective, it isn't the
> consideration of putting one's faith in Jesus' life as a model for one's
> own life that's the problem for atheists, it's the man-made religion
> that has been built up around it.

Atheists, yes. AltAtheism atheists are a different matter.

> To put it in yet another perspective, what makes atheists dubious is the
> religion. As soon as religion is introduced the barriers go up; and this
> is understandable.
>
> In this sense then, without being an atheist myself, and maintaining my
> agnosticism to the question of any god, I am on the side of the atheist
> in this regard.

I'm sorry you are taking sides.

Humanity will only respond to lies for a certain period. This is an
historical fact.

There are two things right now, among many, that humanity seems
wrestles about, but they cannot put their finger on it. When they do,
these two things will be cast aside.

The first is organized-money-driven religions and the second is
science, which is driven by the same kind of greed today. These two
warring factions keep people divided and seperated from the truth with
their agendas. They also keep the people from knowing themselves and
from knowing God.

This combination is explosive and it is only a matter of time before
the problem erupts.

bpuharic

4/24/2011 3:07:00 AM

0

On Tue, 19 Apr 2011 16:51:47 -0700 (PDT), AllSeeing-I
<allseeingi@usa.com> wrote:


>No.
>
>Unfortunately it may mean that Christianity has become less then a
>perfect religion over the years. God is known to withdraw his grace
>when a people turn away from him.
>
>Like it of not, most Christians do not know their faith, nor do they
>practice it everyday.
>
>Some of them even fall prey to the lies you preach and actually begin
>to believe that God used evolution to create.

funny. you guys said the same things to galileo

how'd that work out?

>
>.

bpuharic

4/24/2011 3:10:00 AM

0

On Sat, 23 Apr 2011 12:06:54 -0700 (PDT), AllSeeing-I
<allseeingi@usa.com> wrote:

>Nevertheless, religion per se is in fact, nothing more then a man made
>endeavor. It is riddled with man made rules and man made precepts that
>are not from God.

eg the literal truth of the bible


This is also a subject that was dear to Jesus and
>further illustrates that he did not come to start a religion. Quite
>the contrary. Simply put, he despised the religious leaders of his day
>because they placed their personal and made up laws before God's
>laws.
>
>> In support of that latter point:
>> If one of the claims of the New Testament is assumed to be true, viz
>> faith alone (ignoring the wholly contradictory Pauline bits about the
>> place of good works), then no religion is necessary. Furthermore,
>> neither is the NT necessary; the only role of the NT is merely to tell a
>> certain story that one ought to consider putting their faith in.
>
>Right. For the early Christians this is the way it was. Constantine
>had a revelation, which got the whole idea of Christianity as a major
>national religion ball rolling. However, Paul did his part to bring
>the good news to the gentiles.

?? where did he have a 'revelation'?? we have a politician who's using
religion for his own purposes....an exercise which neither began nor
ended with constantine

and you think he was telling the truth

rack up another bizarre belief for the creationist.

>
>The only thing left to do not is to decide whether or not the texts
>are wrong, made up, or nothing more then lies.

and you simply make up a way of interpreting them that makes them a
lie