fix codetest failure - ASSERT_ARGS does not have a ; after and
[parrot.git] / docs / pmc / documentation.pod
blob666d8a013e2fe61a891eba6409337d29701a2da2
1 =head1 TITLE
3 Documenting PMCs
5 =head1 Overview
7 This document describes guidelines for writing documentation for PMCs.
8 All core PMCs B<must> be documented using the format outlined here.
9 We encourage other PMC developers to follow these practices, too.
11 Follow all documentation guidelines in F<docs/pdds/pdd07_codingstd.pod>.
13 =over
15 =item NAME
17 Required. Specify the filename relative to the Parrot root, followed by
18 a brief description of the PMC's intent.
20  =head1 NAME
22  src/pmc/exporter.pmc - Export globals from one namespace to another
24 =item DESCRIPTION
26 Required. A verbose description of the PMC's intent, mentioning the major
27 use cases. Include links to spec/design documentation or other related
28 files. Describe the interface (what this PMC inherits from, and what
29 interfaces it provides) -- a description of the information contained
30 in the C<pmclass> declaration.
32  =head1 DESCRIPTION
34  Exports globals from one namespace to another. Exporter always uses
35  the typed namespace interface, as outlined in
36  F<docs/pdds/pdd21_namespaces.pod>.
38  Exporter is not derived from any other PMC, and does not provide any
39  standard interface--its interface consists solely of methods, not
40  vtable functions.
42 The B<DESCRIPTION> section is further broken down as follows:
44 =over 4
46 =item Structure
48 Describe the underlying structure of the PMC. Often this information
49 has been contained in source comments. It should be formalized and made
50 available to others by converting it to POD. Mention initialization and
51 finalization behavior.
53  =head2 Structure
55  The Exporter PMC structure (C<Parrot_Exporter>) consists of three items:
57  =over 4
59  =item C<ns_src>
61  The source namespace -- a NameSpace PMC.
62  An empty PMC of this type is allocated upon initialization.
64  =item C<ns_dest>
66  The destination namespace -- a NameSpace PMC.
67  An empty PMC of this type is allocated upon initialization.
69  =item C<globals>
71  The globals to export -- a ResizableStringArray.
72  A Null PMC is allocated during initialization.
74 =item Functions
76 Required. Group all PMC functions together in the source, and describe them
77 individually.
79  =head2 Functions
81  =over 4
83  =item C<void init()>
85  Instantiates an Exporter.
87 etc.
89 =item Methods
91 Required. Group all PMC methods together (VTABLE or otherwise,)
92 and describe function, expected parameters, and return values.
94  =head2 Methods
96  =over 4
98  =item C<PCCMETHOD
99  import(PMC *dest :optional :named["destination"], int got_dest :opt_flag,
100  PMC *src :optional :named["source"], int got_src :opt_flag,
101  PMC *globals :optional :named["globals"], int got_globals :opt_flag)>
103  Import C<globals> from the C<src> namespace to the C<dest> namespace.
104  If C<src>, C<dest>, or C<globals> are passed, they will override
105  the current value.
106  C<import> follows the semantics of the C<export_to> method
107  of the C<NameSpace> PMC. in particular, if a NULL value is passed
108  for C<globals>, the default set of items will be imported.
109  Throws an exception upon error.
111 =back
113 =item STABILITY
115 Required. List the stability of this PMC, as classified in
116 F<docs/stability.pod>.
118 =item SEE ALSO
120 Recommended. List related documentation.
122  =head1 SEE ALSO
124  F<docs/pdds/pdd17_basic_types.pod>, F<docs/pdds/pdd21_namespaces.pod>.
126 =back
128 =head1 STABILITY
130 Unstable. This is a draft document, which must be reviewed and accepted by the Project Team.
132 =cut