 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
White Wolf Guest
|
Posted: Mon Feb 21, 2005 10:36 pm Post subject: try-catch name |
|
|
Hi,
I cannot believe my eyes, but so far I could not find out what is the name
of the construct, which is built from one try block and the catch clauses
(handlers). I am not looking for a grammar name, but something people can
remember, like handler. But is not handler, because those are the catch
clauses and the try does not belong there. I have looked at all my books
and the standard, but I could not find a name. :-(
Is there anyone who knows that name? If there is, please share it with me
here. :-)
--
WW aka Attila
:::
RTFM: Not just an acronym, it's the LAW!
|
|
| Back to top |
|
 |
GB Guest
|
Posted: Mon Feb 21, 2005 10:43 pm Post subject: Re: try-catch name |
|
|
White Wolf wrote:
| Quote: | Hi,
I cannot believe my eyes, but so far I could not find out what is the name
of the construct, which is built from one try block and the catch clauses
(handlers). I am not looking for a grammar name, but something people can
remember, like handler. But is not handler, because those are the catch
clauses and the try does not belong there. I have looked at all my books
and the standard, but I could not find a name. :-(
Is there anyone who knows that name? If there is, please share it with me
here. :-)
|
It's called a try statement.
Gregg
|
|
| Back to top |
|
 |
White Wolf Guest
|
Posted: Mon Feb 21, 2005 10:52 pm Post subject: Re: try-catch name |
|
|
GB wrote:
| Quote: | White Wolf wrote:
Hi,
I cannot believe my eyes, but so far I could not find out what is the
name of the construct, which is built from one try block and the catch
clauses (handlers). I am not looking for a grammar name, but something
people can remember, like handler. But is not handler, because those
are the catch clauses and the try does not belong there. I have looked
at all my books and the standard, but I could not find a name. :-(
Is there anyone who knows that name? If there is, please share it with
me here. :-)
It's called a try statement.
|
Thanks. Could you tell me where can this be found? I have tried to find
"try statement" in the standard, in The C++ Programming Language Spec.
Edition and even Google.
As far as I can see the try statement is not used by C++ literature (it is
used in C# and Python), or where it is used it is used either as the synonim
for the try keyword or the try expression, none of which contains the whole
try-and-all-catch thing. That is why I have asked for source of
information, I cannot seem to find it.
--
WW aka Attila
:::
Give a man a fish and he will eat for a day. Teach a man to fish and he
will sit in a boat all day drinking beer.
|
|
| Back to top |
|
 |
GB Guest
|
Posted: Mon Feb 21, 2005 11:12 pm Post subject: Re: try-catch name |
|
|
White Wolf wrote:
| Quote: | GB wrote:
White Wolf wrote:
Hi,
I cannot believe my eyes, but so far I could not find out what is the
name of the construct, which is built from one try block and the catch
clauses (handlers). I am not looking for a grammar name, but something
people can remember, like handler. But is not handler, because those
are the catch clauses and the try does not belong there. I have looked
at all my books and the standard, but I could not find a name. :-(
Is there anyone who knows that name? If there is, please share it with
me here. :-)
It's called a try statement.
Thanks. Could you tell me where can this be found? I have tried to find
"try statement" in the standard, in The C++ Programming Language Spec.
Edition and even Google.
As far as I can see the try statement is not used by C++ literature (it is
used in C# and Python), or where it is used it is used either as the synonim
for the try keyword or the try expression, none of which contains the whole
try-and-all-catch thing. That is why I have asked for source of
information, I cannot seem to find it.
|
Well I have to admit, I looked (albeit briefly) and couldn't find a
definite answer either. That's just how I would refer to it. The grammar
treats the try-block as a statement and the catch handler as a
statement, but it is a semantic error to have one without the other, so
the whole construct would appear to me to be a statement. It is
certainly true that the whole construct can be used as one. For example:
if (cond)
try {
}
catch (...) {
}
I think maybe the standard calls the whole construct an exception
handler, which consists of a try clause and a catch clause.
Gregg
|
|
| Back to top |
|
 |
GB Guest
|
Posted: Mon Feb 21, 2005 11:16 pm Post subject: Re: try-catch name |
|
|
White Wolf wrote:
| Quote: | GB wrote:
White Wolf wrote:
Hi,
I cannot believe my eyes, but so far I could not find out what is the
name of the construct, which is built from one try block and the catch
clauses (handlers). I am not looking for a grammar name, but something
people can remember, like handler. But is not handler, because those
are the catch clauses and the try does not belong there. I have looked
at all my books and the standard, but I could not find a name. :-(
Is there anyone who knows that name? If there is, please share it with
me here. :-)
It's called a try statement.
Thanks. Could you tell me where can this be found? I have tried to find
"try statement" in the standard, in The C++ Programming Language Spec.
Edition and even Google.
As far as I can see the try statement is not used by C++ literature (it is
used in C# and Python), or where it is used it is used either as the synonim
for the try keyword or the try expression, none of which contains the whole
try-and-all-catch thing. That is why I have asked for source of
information, I cannot seem to find it.
|
Well I have to admit, I looked (albeit briefly) and couldn't find a
definite answer either. That's just how I would refer to it. The grammar
treats the try-block itself as a statement, but it would be a semantic
error to have the try-block without one or more matching catch clauses,
so the whole construct would appear to me to be a statement. It is
certainly true that the whole construct can be used as one. For example:
if (cond)
try {
}
catch (const myexc&) {
}
catch (...) {
}
I think actually the standard calls the whole construct an exception
handler, which consists of a try clause and a catch clause.
Gregg
|
|
| Back to top |
|
 |
GB Guest
|
Posted: Mon Feb 21, 2005 11:18 pm Post subject: Re: try-catch name |
|
|
White Wolf wrote:
| Quote: | GB wrote:
White Wolf wrote:
Hi,
I cannot believe my eyes, but so far I could not find out what is the
name of the construct, which is built from one try block and the catch
clauses (handlers). I am not looking for a grammar name, but something
people can remember, like handler. But is not handler, because those
are the catch clauses and the try does not belong there. I have looked
at all my books and the standard, but I could not find a name. :-(
Is there anyone who knows that name? If there is, please share it with
me here. :-)
It's called a try statement.
Thanks. Could you tell me where can this be found? I have tried to find
"try statement" in the standard, in The C++ Programming Language Spec.
Edition and even Google.
As far as I can see the try statement is not used by C++ literature (it is
used in C# and Python), or where it is used it is used either as the synonim
for the try keyword or the try expression, none of which contains the whole
try-and-all-catch thing. That is why I have asked for source of
information, I cannot seem to find it.
|
Well I have to admit, I looked (albeit briefly) and couldn't find a
definite answer either. That's just how I would refer to it. The grammar
treats the try-block itself as a statement, but it would be a semantic
error to have the try-block without one or more matching catch clauses,
so the whole construct would appear to me to be a statement. It is
certainly true that the whole construct can be used as one. For example:
if (cond)
try {
}
catch (const myexc&) {
}
catch (...) {
}
I think actually the standard calls the whole construct an exception
handler, which consists of a try clause and one or more catch clauses.
Gregg
|
|
| Back to top |
|
 |
GB Guest
|
Posted: Mon Feb 21, 2005 11:24 pm Post subject: Re: try-catch name |
|
|
GB wrote:
| Quote: |
I think actually the standard calls the whole construct an exception
handler, which consists of a try clause and one or more catch clauses.
|
For example, in section 1.3.9, it refers to the "catch clause of an
exception handler".
Gregg
|
|
| Back to top |
|
 |
White Wolf Guest
|
Posted: Tue Feb 22, 2005 12:17 am Post subject: Re: try-catch name |
|
|
GB wrote:
| Quote: | GB wrote:
I think actually the standard calls the whole construct an exception
handler, which consists of a try clause and one or more catch clauses.
For example, in section 1.3.9, it refers to the "catch clause of an
exception handler".
|
Thank you for the help!
I think that the confusion is then complete. C++ Primer excusively
calls the catch clauses handlers, and so does the grammar. So I guess I
have to call it try-catch or try&catch until a better name comes along. I
would just allow room for ambiguity with either (otherwise good) name. :-(
--
WW aka Attila
:::
The easiest way to find something lost around the house is to buy a
replacement.
|
|
| Back to top |
|
 |
Alf P. Steinbach Guest
|
Posted: Tue Feb 22, 2005 12:43 am Post subject: Re: try-catch name |
|
|
* White Wolf:
| Quote: | GB wrote:
GB wrote:
I think actually the standard calls the whole construct an exception
handler, which consists of a try clause and one or more catch clauses.
For example, in section 1.3.9, it refers to the "catch clause of an
exception handler".
Thank you for the help!
I think that the confusion is then complete. C++ Primer excusively
calls the catch clauses handlers, and so does the grammar. So I guess I
have to call it try-catch or try&catch until a better name comes along. I
would just allow room for ambiguity with either (otherwise good) name.
|
How about "try-catch statement"?
Just ignore the darned standard, it's very non-standard (heh) in its
terminology...
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
|
|
| Back to top |
|
 |
White Wolf Guest
|
Posted: Tue Feb 22, 2005 12:51 am Post subject: Re: try-catch name |
|
|
Alf P. Steinbach wrote:
| Quote: | * White Wolf:
GB wrote:
GB wrote:
I think actually the standard calls the whole construct an exception
handler, which consists of a try clause and one or more catch clauses.
For example, in section 1.3.9, it refers to the "catch clause of an
exception handler".
Thank you for the help!
I think that the confusion is then complete. C++ Primer excusively
calls the catch clauses handlers, and so does the grammar. So I guess I
have to call it try-catch or try&catch until a better name comes along.
I would just allow room for ambiguity with either (otherwise good)
name. :-(
How about "try-catch statement"?
|
I will probably use that where it fits (I admit I make slides ).
| Quote: | Just ignore the darned standard, it's very non-standard (heh) in its
terminology...
|
When I will be in the position that enables me to create C++ technical
terminology, I will certainly do that. Until then, I should stick with what
serves my target audience best.
--
WW aka Attila
:::
How come I can never find Troi when I'm mad at her?
|
|
| Back to top |
|
 |
GB Guest
|
Posted: Tue Feb 22, 2005 1:20 am Post subject: Re: try-catch name |
|
|
White Wolf wrote:
| Quote: | GB wrote:
GB wrote:
I think actually the standard calls the whole construct an exception
handler, which consists of a try clause and one or more catch clauses.
For example, in section 1.3.9, it refers to the "catch clause of an
exception handler".
Thank you for the help!
I think that the confusion is then complete. C++ Primer excusively
calls the catch clauses handlers, and so does the grammar. So I guess I
have to call it try-catch or try&catch until a better name comes along. I
would just allow room for ambiguity with either (otherwise good) name. :-(
|
I see I was mistaken when I said that the grammar treats the try part
alone as a statement. The grammar uses the term try-block to refer to
the whole construct, including the catch clauses, not just the try part.
However, both the standard and Stroustrup's book use the term "try
block" to refer to the try part alone. For example, at the end of page
187, he says "If any code in a try block - or called from it - throws an
exception, the try block's handlers will be examined." However, this is
not literally true if the exception handlers themselves are considered
part of the try block.
Gregg
|
|
| Back to top |
|
 |
White Wolf Guest
|
Posted: Tue Feb 22, 2005 1:44 am Post subject: Re: try-catch name |
|
|
GB wrote:
[SNIP]
| Quote: | I see I was mistaken when I said that the grammar treats the try part
alone as a statement. The grammar uses the term try-block to refer to
the whole construct, including the catch clauses, not just the try part.
However, both the standard and Stroustrup's book use the term "try
block" to refer to the try part alone. For example, at the end of page
187, he says "If any code in a try block - or called from it - throws an
exception, the try block's handlers will be examined." However, this is
not literally true if the exception handlers themselves are considered
part of the try block.
|
Yep, there seems to be a bit of confusion around the terminology. :-(
--
WW aka Attila
:::
Whoever said nothing is impossible never tried slamming a revolving door.
|
|
| Back to top |
|
 |
Ron Natalie Guest
|
Posted: Tue Feb 22, 2005 2:26 pm Post subject: Re: try-catch name |
|
|
GB wrote:
| Quote: |
It's called a try statement.
|
Actually the terminonlogy in the standard is "try-block"
(which is a statement).
|
|
| Back to top |
|
 |
White Wolf Guest
|
Posted: Tue Feb 22, 2005 5:01 pm Post subject: Re: try-catch name |
|
|
Ron Natalie wrote:
| Quote: | GB wrote:
It's called a try statement.
Actually the terminonlogy in the standard is "try-block"
(which is a statement).
|
As far as I saw that only covers the try part, but not the handlers. At
least according to the grammar part, and according to C++ Primer 3rd
edition.
--
WW aka Attila
:::
It is far more impressive when others discover your good qualities without
your help.
|
|
| Back to top |
|
 |
Ron Natalie Guest
|
Posted: Tue Feb 22, 2005 5:55 pm Post subject: Re: try-catch name |
|
|
White Wolf wrote:
| Quote: | Ron Natalie wrote:
GB wrote:
It's called a try statement.
Actually the terminonlogy in the standard is "try-block"
(which is a statement).
As far as I saw that only covers the try part, but not the handlers. At
least according to the grammar part, and according to C++ Primer 3rd
edition.
Nope, it covers everything. try-block is "try compound-statement handler-seq". |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|