Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
4cd9a053
Commit
4cd9a053
authored
Jul 16, 2013
by
Giuseppe Castagna
Browse files
Reworked examples
parent
d66e11fe
Changes
2
Show whitespace changes
Inline
Side-by-side
Makefile
View file @
4cd9a053
...
...
@@ -107,8 +107,7 @@ driver/examples.ml: cduce web/xhtml.cdo web/examples/build.cd web/examples/examp
WEBIFACE
=
$(OBJECTS)
driver/examples.cmo driver/webiface.cmo
EVALUATOR
=
$(OBJECTS)
driver/evaluator.cmo
webiface
:
misc/q_symbol.cmo
$
(
WEBIFACE:.cmo
=
.
$(EXTENSION)
)
webiface
:
$(WEBIFACE:.cmo=.$(EXTENSION))
@
echo
"Build
$@
"
$(HIDE)$(LINK)
-verbose
$(INCLUDES)
-o
$@
$^
$(EXTRA_OPTS_WEBIFACE)
...
...
driver/examples.ml
View file @
4cd9a053
...
...
@@ -1446,27 +1446,8 @@ debug compile [A+|B+] [A+] [B+]
fun ([A+|B+] -> Int) [ <a>_ ; _ ] -> 0 | _ -> 1
*)
"
;
]
let
present
=
"<ul><li><a href=
\"
/cgi-bin/cduce?example=q1
\"
>Q1.</a>
Q1 Query
</li><li><a href=
\"
/cgi-bin/cduce?example=q2
\"
>Q2.</a>
Q2 Query
</li><li><a href=
\"
/cgi-bin/cduce?example=q3
\"
>Q3.</a>
Q3 Query
</li><li><a href=
\"
/cgi-bin/cduce?example=q4
\"
>Q4.</a>
Q4 Query
</li><li><a href=
\"
/cgi-bin/cduce?example=q5
\"
>Q5.</a>
Q5 Query
</li><li><a href=
\"
/cgi-bin/cduce?example=q6
\"
>Q6.</a>
Q6 Query
</li><li><a href=
\"
/cgi-bin/cduce?example=q8
\"
>Q8.</a>
Q8 Query
</li><li><a href=
\"
/cgi-bin/cduce?example=q9
\"
>Q9.</a>
Q9 Query
</li><li><a href=
\"
/cgi-bin/cduce?example=q11
\"
>Q11.</a>
Q11 Query
</li><li><a href=
\"
/cgi-bin/cduce?example=q12
\"
>Q12.</a>
Q12 Query
</li><li><a href=
\"
/cgi-bin/cduce?example=qatt1
\"
>Attributes and elements.</a>
let
present
=
"<ul>
<li><a href=
\"
/cgi-bin/cduce?example=qatt1
\"
>Attributes and elements.</a>
Part 1
</li><li><a href=
\"
/cgi-bin/cduce?example=qatt2
\"
>Attributes and elements.</a>
Part 2
...
...
@@ -1501,4 +1482,31 @@ Mutable values.
</li><li><a href=
\"
/cgi-bin/cduce?example=pm_compil
\"
>Compilation of pattern matching.</a>
This example demonstrates the efficient compilation of pattern
matching.
</li><li><a href=
\"
/cgi-bin/cduce?example=q1
\"
>Q1.</a>
Q1 Query: List books published by Addison-Wesley after 1991, including their year and title.
</li><li><a href=
\"
/cgi-bin/cduce?example=q2
\"
>Q2.</a>
Q2 Query: Create a flat list of all the title-author pairs, with each pair enclosed in a
\"
result
\"
element.
</li><li><a href=
\"
/cgi-bin/cduce?example=q3
\"
>Q3.</a>
Q3 Query: For each book in the bibliography, list the title and authors, grouped inside a
\"
result
\"
element.
</li><li><a href=
\"
/cgi-bin/cduce?example=q4
\"
>Q4.</a>
Q4 Query: For each author in the bibliography, list the author`s name and the titles
of all books by that author, grouped inside a
\"
result
\"
element.
</li><li><a href=
\"
/cgi-bin/cduce?example=q5
\"
>Q5.</a>
Q5 Query: For each book found at both bstore1.example.com and bstore2.example.com,
list the title of the book and its price from each source.
</li><li><a href=
\"
/cgi-bin/cduce?example=q6
\"
>Q6.</a>
Q6 Query: For each book that has at least one author, list the title and first two authors,
and an empty
\"
et-al
\"
element if the book has additional authors.
</li><li><a href=
\"
/cgi-bin/cduce?example=q8
\"
>Q8.</a>
Q8 Query: Find books in which the name of some element ends with the string
\"
or
\"
and the same element contains the string
\"
Suciu
\"
somewhere in its content.
For each such book, return the title and the qualifying element.
</li><li><a href=
\"
/cgi-bin/cduce?example=q9
\"
>Q9.</a>
Q9 Query: In the document
\"
books.xml
\"
, find all section or chapter titles that
contain the word
\"
XML
\"
, regardless of the level of nesting.
</li><li><a href=
\"
/cgi-bin/cduce?example=q11
\"
>Q11.</a>
Q11 Query: For each book with an author, return the book with its title and authors.
For each book with an editor, return a reference with the book title and the editor`s affiliation.
</li><li><a href=
\"
/cgi-bin/cduce?example=q12
\"
>Q12.</a>
Q12 Query: Find pairs of books that have different titles but the same set of authors (possibly in a different order).
</li></ul>"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment