Content deleted Content added
Adding Perl to the list of programming languages. |
m v2.05b - Bot T20 CW#61 - Fix errors for CW project (Reference before punctuation) |
||
Line 41:
{{Further|Exception handling syntax}}
Many computer languages have built-in syntactic support for exceptions and exception handling. This includes [[ActionScript]], [[Ada programming language|Ada]], [[BlitzMax]], [[C++]], [[C Sharp (programming language)|C#]], [[Clojure]], [[COBOL]], [[D programming language|D]], [[ECMAScript]], [[Eiffel (programming language)|Eiffel]], [[Java (programming language)|Java]], [[ML programming language|ML]], [[Object Pascal]] (e.g. [[Delphi (programming language)|Delphi]], [[Free Pascal]], and the like), [[PowerBuilder]], [[Objective-C]], [[OCaml]], Perl,<ref>{{Cite web |title=Exceptions - Documentation for exception handling in Perl |url=https://metacpan.org/pod/Exceptions}}</ref>
Excluding minor syntactic differences, there are only a couple of exception handling styles in use. In the most popular style, an exception is initiated by a special statement (<code>throw</code> or <code>raise</code>) with an exception object (e.g. with Java or Object Pascal) or a value of a special extendable enumerated type (e.g. with Ada or SML). The scope for exception handlers starts with a marker clause (<code>try</code> or the language's block starter such as <code>begin</code>) and ends in the start of the first handler clause (<code>catch</code>, <code>except</code>, <code>rescue</code>). Several handler clauses can follow, and each can specify which exception types it handles and what name it uses for the exception object. As a minor variation, some languages use a single handler clause, which deals with the class of the exception internally.
|