develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33984 - in trunk/languages/perl6: config/makefiles src/classes

From:
tene
Date:
December 16, 2008 13:59
Subject:
[svn:parrot] r33984 - in trunk/languages/perl6: config/makefiles src/classes
Message ID:
20081216215942.8B756CBADF@x12.develooper.com
Author: tene
Date: Tue Dec 16 13:59:39 2008
New Revision: 33984

Added:
   trunk/languages/perl6/src/classes/Exception.pir
Modified:
   trunk/languages/perl6/config/makefiles/root.in
   trunk/languages/perl6/src/classes/Failure.pir

Log:
[rakudo]
* move Exception clas sinto a new file
* add resume() and rethrow() to Exception

Modified: trunk/languages/perl6/config/makefiles/root.in
==============================================================================
--- trunk/languages/perl6/config/makefiles/root.in	(original)
+++ trunk/languages/perl6/config/makefiles/root.in	Tue Dec 16 13:59:39 2008
@@ -75,6 +75,7 @@
   src/classes/Method.pir \
   src/classes/Junction.pir \
   src/classes/Failure.pir \
+  src/classes/Exception.pir \
   src/classes/Nil.pir \
   src/classes/Role.pir \
   src/classes/Pair.pir \

Added: trunk/languages/perl6/src/classes/Exception.pir
==============================================================================
--- (empty file)
+++ trunk/languages/perl6/src/classes/Exception.pir	Tue Dec 16 13:59:39 2008
@@ -0,0 +1,30 @@
+# $Id$
+
+
+.namespace [ 'Exception' ]
+
+.sub '' :anon :init :load
+    .local pmc p6meta, failureproto, exceptionproto
+    p6meta = get_hll_global ['Perl6Object'], '$!P6META'
+    exceptionproto = p6meta.'new_class'('Perl6Exception', 'parent'=>'Any Exception', 'attr'=>'$!exception', 'name'=>'Exception')
+    p6meta.'register'('Exception', 'protoobject'=>exceptionproto)
+.end
+
+=head2 Methods
+
+=cut
+
+.sub 'resume' :method
+    .local pmc resume
+    resume = self['resume']
+    resume()
+.end
+
+.sub 'rethrow' :method
+    rethrow self
+.end
+
+
+.sub 'perl' :method
+    .return ('undef')
+.end

Modified: trunk/languages/perl6/src/classes/Failure.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Failure.pir	(original)
+++ trunk/languages/perl6/src/classes/Failure.pir	Tue Dec 16 13:59:39 2008
@@ -8,8 +8,6 @@
     p6meta = get_hll_global ['Perl6Object'], '$!P6META'
     failureproto = p6meta.'new_class'('Failure', 'parent'=>'Undef Any', 'attr'=>'$!exception')
     p6meta.'register'('Undef', 'parent'=>failureproto, 'protoobject'=>failureproto)
-    exceptionproto = p6meta.'new_class'('Perl6Exception', 'parent'=>'Any Exception', 'attr'=>'$!exception', 'name'=>'Exception')
-    p6meta.'register'('Exception', 'protoobject'=>exceptionproto)
 
     $P0 = box 1
     set_hll_global '$WARNINGS', $P0



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About