2007-09-10 Juerg Billeter <j@bitron.ch>
* doc/vala/structs.xml: document struct declarations
svn path=/trunk/; revision=600
+2007-09-10 Jürg Billeter <j@bitron.ch>
+
+ * doc/vala/structs.xml: document struct declarations
+
2007-09-09 Jürg Billeter <j@bitron.ch>
* vala/valasymbolresolver.vala: detect interface prerequisite cycle
<?xml version="1.0"?>
<section id="structs">
<h>Structs</h>
+ <p>A struct is a data type that can contain fields, constants, and methods.</p>
+ <section id="declaration">
+ <h>Struct declarations</h>
+ <p>The simplest struct declaration looks like this:</p>
+ <blockcode>
+struct StructName {
+ <struct-member>
+}</blockcode>
+ <p>You may optionally specify an accessibility modifier. Structs support <code>public</code> and <code>private</code> accessibility and default to private if you don't specify one. Public structs may be accessed from outside the library or application they are defined in.</p>
+ <blockcode>
+public struct StructName {
+ <struct-member>
+}</blockcode>
+ <p>You may optionally prefix the struct name with a namespace name. This places the struct in the specified namespace without the need for a separate namespace declaration.</p>
+ <blockcode>
+struct NamespaceName.StructName {
+ <struct-member>
+}</blockcode>
+ </section>
</section>