Revision 28197
- Date:
- 2009/09/07 17:30:17
- Files:
Legend:
- Added
- Removed
- Modified
-
docs/Perl6/Spec/S12-objects.pod
55 55 class is also a module, it also handles any module-oriented keywords. 56 56 You can export subs from a class at "use" time, for instance.) 57 57 58 If the class body throws an exception from a literal C<...> (yada) term, 59 the class defintion is considered incomplete, and a second definition of 60 that class does not complain, so you can write 58 If the class body consists only of a literal C<...> (yada) term, it is 59 interpreted as a forward declaration that just tells the compiler that the 60 class name is a type name, to be defined later on. 61 61 62 class Foo { 63 has $!some_attr; 64 65 ... # literal ... here interrrupts class definition 66 } 67 68 # other code here 69 70 class Foo { 71 # rest of class defintion here 72 } 73 74 62 A named class declaration can occur as part of an expression, just like 75 63 named subroutine declarations. 76 64