/[svn]/web/examples.xml
ViewVC logotype

Contents of /web/examples.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 381 - (show annotations)
Tue Jul 10 17:30:23 2007 UTC (5 years, 11 months ago) by abate
File MIME type: text/xml
File size: 1497 byte(s)
[r2003-05-21 18:22:47 by cvscast] Start manual

Original author: cvscast
Date: 2003-05-21 18:22:50+00:00
1 <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
2 <page name="examples">
3
4 <title>Code examples</title>
5
6 <left>
7 <p>This page presents some simple CDuce programs.</p>
8 <boxes-toc/>
9 <p>See also:</p>
10 <local-links href="index,proto,memento"/>
11 </left>
12
13 <box title="Our canonical example" link="sort">
14 <p>
15 The example below is the one we use to demonstrate
16 how overloaded functions can avoid duplicating code.
17 Without overloaded functions, we would need to define
18 two mutually recursive functions in order to type-check
19 the transformation. Here, two constraints
20 in the (highlighted) function interface
21 can express precisely the behaviour of the function.
22 </p>
23 <sample>
24 <include-verbatim file="overloading.cd"/>
25 </sample>
26 </box>
27
28 <box title="The script that generates this site" link="site">
29 <p>
30 The script below is one of the longest CDuce application ever written
31 ;-) It is used to produce all the pages of this web site (except
32 the <local href="proto">web prototype</local> which is
33 a CGI script written in OCaml). CDuce type system ensures
34 that produced pages are valid w.r.t XHTML 1.0 Strict.
35 </p>
36 <p>
37 This program features both XML and text-content manipulation.
38 It also demonstrates the use of non-XML internal data structures.
39 Here, a tree represents internally the site
40 structure, and a list represents the path from the
41 root to the current page (in order to display the "You're here" line).
42 </p>
43 <sample highlight="false">
44 <include-verbatim file="site.cd"/>
45 </sample>
46 </box>
47
48 </page>
49

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5