Author: moritz
Date: 2009-09-07 08:48:34 +0200 (Mon, 07 Sep 2009)
New Revision: 28196
Modified:
docs/Perl6/Spec/S12-objects.pod
Log:
[S12] spec behaviour of stubbed classes
This is a bit more general than what I had in mind first. If the implementors
say this is too hard to do it this way, we can degrade it to allow only a single
'...' term in the body of a stubbed class.
Modified: docs/Perl6/Spec/S12-objects.pod
===================================================================
--- docs/Perl6/Spec/S12-objects.pod 2009-09-06 15:06:11 UTC (rev 28195)
+++ docs/Perl6/Spec/S12-objects.pod 2009-09-07 06:48:34 UTC (rev 28196)
@@ -55,6 +55,22 @@
class is also a module, it also handles any module-oriented keywords.
You can export subs from a class at "use" time, for instance.)
+If the class body throws an exception from a literal C<...> (yada) term,
+the class defintion is considered incomplete, and a second definition of
+that class does not complain, so you can write
+
+ class Foo {
+ has $!some_attr;
+
+ ... # literal ... here interrrupts class definition
+ }
+
+ # other code here
+
+ class Foo {
+ # rest of class defintion here
+ }
+
A named class declaration can occur as part of an expression, just like
named subroutine declarations.