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
83eadb0f
Commit
83eadb0f
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2003-11-25 14:18:26 by cmiachon] comments about q6
Original author: cmiachon Date: 2003-11-25 14:18:26+00:00
parent
5875ec54
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/cql/q6.cd
View file @
83eadb0f
...
...
@@ -5,7 +5,11 @@ let fun count([Any*]->Int)
(***************************)
(*****************************************************************
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.
******************************************************************)
let q6x=
<bib>
select
...
...
@@ -23,3 +27,39 @@ select <book>[t !a !(if etal=[] then [] else [<et-al>[]])]
from <bib>[b::Book*] in [doc],
<book>[t&Title ( a&Author | a::(Author Author) etal::_*) Publisher _*] in b;;
(* le typage est differents entre q6x et q6p:
on a pour q6x:
<bib {| |}>[ <book {| |}>[ X1 X2 | X1 X2 X2 | X1 X2 X2
<et-al {| |}>[ ] | X1 ]* ] where
X1 = <title>[ Char* ] and
X2 = <author>[ Last First ]
et pour q6p:
<bib {| |}>[ <book {| |}>[ Title Author | Title Author Author |
Title Author Author X1 | Title Author X1 ]* ] where
X1 = <et-al {| |}>[ ]
Dans le premier cas on a soit
+ Title Author = Ok
+ Title Author Author = Ok
+ Title Author Author Et-aL = Ok
+ Title = pas possible d etre dans ce cas
avec la condition, mais le typage ne peut le
detecter
Dans le deuxieme cas on a soit:
+ Title Author =ok
+ Title Author Author =ok
+ Title Author Author Et-aL =ok
+ Title Author Et-al =ok pas possible aussi mais vient du if
il est rigolo de remarquer que pour cqlx on sait qu on aura pas de Title Author
Et-al et qu en cqlp on sait qu on aura pas de Title tout court
q6x n est pas entierement ecrit en cqlx puisqu on se sert de patterns
patterns qu on pourrait utilise en cqlp et on aurait un type plus fin, mais une
expression plus longue.
*)
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