Commit ba7efa7e 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 b736e529
...@@ -2,30 +2,75 @@ ...@@ -2,30 +2,75 @@
<page name="demo"> <page name="demo">
<title>CDuce demo</title> <title>CDuce demo</title>
<box title="Compilation of pattern matching" link="pm_compil"> <box title="XML elements" link="xml">
<p>This example demonstrates the efficient compilation of pattern <p>XML elements.</p>
matching.</p> <demo><include-verbatim file="examples/xml.cd"/></demo>
<demo><include-verbatim file="examples/pm_compil.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>
<box title="Integers" link="ints"> <box link="sequence" title="Sequence literals">
<p> <p>How to write sequences.</p>
Let's begin with integers, arithmetic, and, obviously, the <demo><include-verbatim file="examples/sequence.cd"/></demo>
factorial function. </box>
</p>
<demo> <box link="seqtypes" title="Sequence types">
let x = 2;; <p>Types for sequences.</p>
let a = x * 10;; <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"/> <box link="ovfun" title="Overloaded functions">
</demo> <p>This examples demonstrates the use of overloaded functions.</p>
<demo><include-verbatim file="examples/ovfun.cd"/></demo>
</box> </box>
<box title="Strings" link="strs"> <box link="note" title="Footnotes">
<demo> <p>This example shows how to bind an XML element with surrounding text.</p>
let x = "abc";; <demo><include-verbatim file="examples/note.cd"/></demo>
let a = [ !x 'xyz' ] @ "123";; </box>
</demo>
<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> </box>
</page> </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