# New Ticket Created by Patrick R. Michaud
# Please include the string: [perl #48320]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48320 >
At the bottom of pdd23 there's an example of creating
and throwing an exception that doesn't work. I suspect
it may just be a case of the documentation being out of date
or things not catching up to the object model, but I'm filing
it as a 'bug' for the moment since the implementation doesn't
match an approved spec.
The code reads:
$P0 = new String
$P0 = "something bad happened"
$P1 = new ['parrot';'exception'], $P0 # create new exception object
throw $P1 # throw it
Running this (and converting String to 'String') results in:
$ cat x.pir
.sub main
$P0 = new 'String'
$P0 = "something bad happened"
$P1 = new ['parrot';'exception'], $P0
throw $P1
.end
$ ./parrot x.pir
error:imcc:syntax error, unexpected COMMA, expecting '\n' (',')
in file 'x.pir' line 4
$
More generally, it might be good to re-review the exceptions pdd
in light of recent changes to the object model and the availability
of PCCMETHODs for various capabilities.
Pm