q6.cd 557 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(*********function *********)
let fun count([Any*]->Int)
	  [] -> 0
	| [h;t] -> 1+count(t);;

(***************************)


let q6x=
<bib>
select 
  <book>
       ([b]/<title>_ @ 
           (match ([b]/<author>_) with 
                 | [a b  _+ ] ->[a b] @ [<et-al>[]]
		 | a ->a ) )    
from b in [doc]/<book>_
where count([b]/<author>_)>=1;;

let q6p=
<bib>
select <book>[t  !a1 !(if el=[] then [] else [<et-al>[]])]
from <bib>[b::Book*] in [doc],
     <book>[t&Title (a1&Author | a1::(Author Author) el::_*) Publisher _*
      ] in b;;