try-catch name

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • White Wolf

    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!


  • GB

    #2
    Re: try-catch name

    White Wolf wrote:[color=blue]
    > 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. :-)
    >[/color]

    It's called a try statement.

    Gregg

    Comment

    • White Wolf

      #3
      Re: try-catch name

      GB wrote:[color=blue]
      > White Wolf wrote:[color=green]
      >> 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. :-)
      >>[/color]
      >
      > It's called a try statement.[/color]

      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.


      Comment

      • GB

        #4
        Re: try-catch name

        White Wolf wrote:[color=blue]
        > GB wrote:
        >[color=green]
        >>White Wolf wrote:
        >>[color=darkred]
        >>>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. :-)
        >>>[/color]
        >>
        >>It's called a try statement.[/color]
        >
        >
        > 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.
        >[/color]

        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

        Comment

        • GB

          #5
          Re: try-catch name

          White Wolf wrote:[color=blue]
          > GB wrote:
          >[color=green]
          >>White Wolf wrote:
          >>[color=darkred]
          >>>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. :-)
          >>>[/color]
          >>
          >>It's called a try statement.[/color]
          >
          >
          > 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.
          >[/color]

          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

          Comment

          • GB

            #6
            Re: try-catch name

            White Wolf wrote:[color=blue]
            > GB wrote:
            >[color=green]
            >>White Wolf wrote:
            >>[color=darkred]
            >>>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. :-)
            >>>[/color]
            >>
            >>It's called a try statement.[/color]
            >
            >
            > 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.[/color]

            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

            Comment

            • GB

              #7
              Re: try-catch name

              GB wrote:[color=blue]
              >
              > I think actually the standard calls the whole construct an exception
              > handler, which consists of a try clause and one or more catch clauses.[/color]

              For example, in section 1.3.9, it refers to the "catch clause of an
              exception handler".

              Gregg

              Comment

              • White Wolf

                #8
                Re: try-catch name

                GB wrote:[color=blue]
                > GB wrote:[color=green]
                >>
                >> I think actually the standard calls the whole construct an exception
                >> handler, which consists of a try clause and one or more catch clauses.[/color]
                >
                > For example, in section 1.3.9, it refers to the "catch clause of an
                > exception handler".[/color]

                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.


                Comment

                • Alf P. Steinbach

                  #9
                  Re: try-catch name

                  * White Wolf:[color=blue]
                  > GB wrote:[color=green]
                  > > GB wrote:[color=darkred]
                  > >>
                  > >> I think actually the standard calls the whole construct an exception
                  > >> handler, which consists of a try clause and one or more catch clauses.[/color]
                  > >
                  > > For example, in section 1.3.9, it refers to the "catch clause of an
                  > > exception handler".[/color]
                  >
                  > 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. :-([/color]

                  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?

                  Comment

                  • White Wolf

                    #10
                    Re: try-catch name

                    Alf P. Steinbach wrote:[color=blue]
                    > * White Wolf:[color=green]
                    >> GB wrote:[color=darkred]
                    >>> 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".[/color]
                    >>
                    >> 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. :-([/color]
                    >
                    > How about "try-catch statement"?[/color]

                    I will probably use that where it fits (I admit I make slides ;-)).
                    [color=blue]
                    > Just ignore the darned standard, it's very non-standard (heh) in its
                    > terminology...[/color]

                    :-) 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?


                    Comment

                    • GB

                      #11
                      Re: try-catch name

                      White Wolf wrote:[color=blue]
                      > GB wrote:
                      >[color=green]
                      >>GB wrote:
                      >>[color=darkred]
                      >>>I think actually the standard calls the whole construct an exception
                      >>>handler, which consists of a try clause and one or more catch clauses.[/color]
                      >>
                      >>For example, in section 1.3.9, it refers to the "catch clause of an
                      >>exception handler".[/color]
                      >
                      >
                      > 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. :-(
                      >[/color]

                      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

                      Comment

                      • White Wolf

                        #12
                        Re: try-catch name

                        GB wrote:
                        [SNIP][color=blue]
                        > 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.[/color]

                        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.


                        Comment

                        • Ron Natalie

                          #13
                          Re: try-catch name

                          GB wrote:
                          [color=blue]
                          >
                          > It's called a try statement.[/color]

                          Actually the terminonlogy in the standard is "try-block"
                          (which is a statement).

                          Comment

                          • White Wolf

                            #14
                            Re: try-catch name

                            Ron Natalie wrote:[color=blue]
                            > GB wrote:
                            >[color=green]
                            >>
                            >> It's called a try statement.[/color]
                            >
                            > Actually the terminonlogy in the standard is "try-block"
                            > (which is a statement).[/color]

                            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.


                            Comment

                            • Ron Natalie

                              #15
                              Re: try-catch name

                              White Wolf wrote:[color=blue]
                              > Ron Natalie wrote:
                              >[color=green]
                              >>GB wrote:
                              >>
                              >>[color=darkred]
                              >>>It's called a try statement.[/color]
                              >>
                              >>Actually the terminonlogy in the standard is "try-block"
                              >>(which is a statement).[/color]
                              >
                              >
                              > 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.
                              >[/color]
                              Nope, it covers everything. try-block is "try compound-statement handler-seq".

                              Comment

                              Working...