Commit d3d92a47 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-12-28 01:55:44 by afrisch] Demo

Original author: afrisch
Date: 2004-12-28 01:55:44+00:00
parent 745f28ef
......@@ -2,30 +2,75 @@
<page name="demo">
<title>CDuce demo</title>
<box title="Compilation of pattern matching" link="pm_compil">
<p>This example demonstrates the efficient compilation of pattern
matching.</p>
<demo><include-verbatim file="examples/pm_compil.cd"/></demo>
<box title="XML elements" link="xml">
<p>XML elements.</p>
<demo><include-verbatim file="examples/xml.cd"/></demo>
</box>
<box link="functions" title="Functions">
<p>Several syntaxes to define functions.</p>
<demo><include-verbatim file="examples/functions.cd"/></demo>
</box>
<box link="mutrec" title="Mutual recursion">
<p>Mutual toplevel definition for types and functions.</p>
<demo><include-verbatim file="examples/mutrec.cd"/></demo>
</box>
<box title="Integers" link="ints">
<p>
Let's begin with integers, arithmetic, and, obviously, the
factorial function.
</p>
<demo>
let x = 2;;
let a = x * 10;;
<box link="sequence" title="Sequence literals">
<p>How to write sequences.</p>
<demo><include-verbatim file="examples/sequence.cd"/></demo>
</box>
<box link="seqtypes" title="Sequence types">
<p>Types for sequences.</p>
<demo><include-verbatim file="examples/seqtypes.cd"/></demo>
</box>
<box link="integers" title="The factorial function">
<p>What about computing 10000! ?</p>
<demo><include-verbatim file="examples/integers.cd"/></demo>
</box>
<box link="sumtype" title="Sum types">
<p>How to simulate ML sum types.</p>
<demo><include-verbatim file="examples/sumtype.cd"/></demo>
</box>
<include-verbatim file="examples/integers.cd"/>
</demo>
<box link="ovfun" title="Overloaded functions">
<p>This examples demonstrates the use of overloaded functions.</p>
<demo><include-verbatim file="examples/ovfun.cd"/></demo>
</box>
<box title="Strings" link="strs">
<demo>
let x = "abc";;
let a = [ !x 'xyz' ] @ "123";;
</demo>
<box link="note" title="Footnotes">
<p>This example shows how to bind an XML element with surrounding text.</p>
<demo><include-verbatim file="examples/note.cd"/></demo>
</box>
<box link="biblio" title="Bibliography">
<p>The good old XML bibliography example.</p>
<demo><include-verbatim file="examples/biblio.cd"/></demo>
</box>
<box link="projection" title="Projection">
<p>Syntactic sugar for projection.</p>
<demo><include-verbatim file="examples/projection.cd"/></demo>
</box>
<box link="xtransform" title="Tree transformations">
<p>How to perform XSLT-like transformations.</p>
<demo><include-verbatim file="examples/xtransform.cd"/></demo>
</box>
<box link="reference" title="References">
<p>Mutable values.</p>
<demo><include-verbatim file="examples/reference.cd"/></demo>
</box>
<box title="Compilation of pattern matching" link="pm_compil">
<p>This example demonstrates the efficient compilation of pattern
matching.</p>
<demo><include-verbatim file="examples/pm_compil.cd"/></demo>
</box>
</page>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment