Commit 555567be authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-06-08 15:29:46 by cvscast] beppe: added example of Unix script

Original author: cvscast
Date: 2003-06-08 15:29:46+00:00
parent a49c4f2d
......@@ -55,6 +55,32 @@ scripts, which are executed successively.</li>
</box>
<box title="Scripting" link="scripting">
<p>
CDuce can also be used for writing using scripts. As usual it suffices to start
the script file by <code> #!%%install_dir%%/cduce</code> to call in a batch way
the cduce interpreter. Here is an example of a script file that prints all the
titles of the filters of an Evolution mail client.
</p>
<sample><![CDATA[
#!/usr/local/bin/cduce
type Filter = <filteroptions>[<ruleset> [(<rule>[<title>String _*])+]];;
let filter : Filter =
match load_xml "/home/beppe/evolution/filters.xml" with
| x&Filter -> x
| _ -> raise "Not a filter document"
in print_xml(<filters>([filter]/<ruleset>_/<rule>_/<title>_)) ;;
]]></sample>
</box>
<box title="Phrases" link="phrases">
<p>
......
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