Fix doc toc misses
[shapes.git] / doc / parts / types / special.sxml
blobd71be5dfc00435b7f7ca761a5fa3acf01052eb62
1 <!-- This file is part of Shapes.                                           -->
2 <!--                                                                        -->
3 <!-- Shapes is free software: you can redistribute it and/or modify         -->
4 <!-- it under the terms of the GNU General Public License as published by   -->
5 <!-- the Free Software Foundation, either version 3 of the License, or      -->
6 <!-- any later version.                                                     -->
7 <!--                                                                        -->
8 <!-- Shapes is distributed in the hope that it will be useful,              -->
9 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of         -->
10 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          -->
11 <!-- GNU General Public License for more details.                           -->
12 <!--                                                                        -->
13 <!-- You should have received a copy of the GNU General Public License      -->
14 <!-- along with Shapes.  If not, see <http://www.gnu.org/licenses/>.        -->
15 <!--                                                                        -->
16 <!-- Copyright 2009, 2013 Henrik Tidefelt                                   -->
18 <section id="types/special">
19 <title>Special types</title>
20 <top>
21         <p>The classes in this section are the foundation of the type hierarchy in <str-Shapes />.  You can do quite a lot in <str-Shapes /> without knowing about these types, but they become central as soon as you want to deal with the types of values.</p>
22 </top>
24   <coretype name="Object">
25     <abstraction>
26                         <p>Every other type in <str-Shapes /> is a subtype of <named-type name="Object" />.</p>
27     </abstraction>
28                 <description>
29                         <p>It is impossible to create values of type <named-type name="Object" />, but the type is useful as the “any type”.</p>
30                         <p>Note that it is by intention that <named-type name="Object" /> has no fields, to avoid name clashes with derived types.  Instead, core functions such as <value namespace="..Shapes" name="typeof" /> are used to access properties of any value.</p>
31                 </description>
32                 <see-also>
33                         <value namespace="..Shapes" name="typeof" /> <value namespace="..Shapes..Data" name="nil?" />
34                 </see-also>
35   </coretype>
37   <coretype name="Class">
38     <abstraction>
39                         <p>The type of types.</p>
40     </abstraction>
41                 <description>
42                         <p>The <named-type name="Class" /> objects are the runtime representation of types in <str-Shapes />.</p>
43                         <p>At the time of writing <str-Shapes /> does not really have a type hierarchy, so there is no way support for checking the subtype relationship (the only non-trivial such relation is that between any type and <named-type name="Object" />, which never has to be tested anyway).  This will change in the future.</p>
44                 </description>
45                 <fields>
46                         <type-field name="name">
47                                 <type><named-type name="String" /></type>
48                                 <description><p>A short textual description of the type, useful for debugging purposes.</p></description>
49                         </type-field>
50                 </fields>
51   </coretype>
53 </section>