tagged release 0.6.4
[parrot.git] / runtime / parrot / library / Parrot / Exception.pir
blobb43461a786bc38813397f43ce78dfdfd971f792e
1 =head1 TITLE
3 Parrot::Exception - Auxiliary methods for Exceptions
5 =head1 VERSION
7  $Id$
9 =head1 SYNOPSIS
11         load_bytecode 'Parrot/Exception.pbc'
12         # ...
13         $S0 = 'XYZ'
14         $P0 = get_class 'Exception'
15         $P1 = $P0.'new'('Error in "', $S0, '" module')
16         throw $P1
18 =head1 DESCRIPTION
20 This module provides some additional support for using Parrot's
21 built-in Exception class.  The principal method is C<new>, which
22 simplifies the task of building and populating Exception objects.
24 =head2 Methods
26 =over 4
28 =item new([arg, ...])
30 Build an C<Exception> object, initializing its message component
31 to be the concatenation of any arguments supplied.  Returns the
32 newly created C<Exception>.
34 =cut
36 .namespace [ 'Exception' ]
38 .sub 'new' :method
39     .param pmc args            :slurpy
40     .local pmc ex
41     .local string message
42     ex = new 'Exception'
43     if null args goto end
44     message = join '', args
45     ex['_message'] = message
46   end:
47     .return (ex)
48 .end
50 =back
52 =head1 AUTHOR
54 Patrick R. Michaud <pmichaud@pobox.com>
56 =head1 COPYRIGHT
58 Copyright (C) 2007-2008, The Perl Foundation.
60 =cut
62 # Local Variables:
63 #   mode: pir
64 #   fill-column: 100
65 # End:
66 # vim: expandtab shiftwidth=4 ft=pir: