[cduce-users] issues about queries

Pierluigi Sanna luzzone at gmail.com
Thu May 11 11:47:38 CEST 2006


Hi, there is no type corresponding to an author; this information is
stored in a string inside a type field(e.g.  <type>author</type>), so
I use the funciont tipi to get a sequence of String, and isAuthor to
kwno if inside this sequence there is a string of type author.

> 1) the atom types in CDuce begin with a backquote ` and not a simple quote
> '. thus here it's `true
>
> 2) where (( tipi(isAuthor c)) = 'true ) is equivalent to where (
> tipi(isAuthor c))
>
> 3) the expression [x]/<nodelist>_/<node ..>_ returns a sequence of node,
> so c is a node.
> The expression isAuthor c needs a sequence of String, however c is a node.
> I think it's: where isAuthor (tipi c))

let tipi (x : node) :  [String*] =
  map [x]/types/type with <type ..>t -> t

let isAuthor (x : [String*]) : Bool = not((select aa
  from aa in x
  where aa = author) = [])

let findAuthors (x : uricloud) : [node*] = select c
  from c in [x]/<nodelist>_/<node ..>_
  where ( isAuthor(tipi c))

Thank you a lot for your help,

Pierluigi
This is exactly what I want to know. I corrected the functions and now
they are working as I intended.
>
>
>
> --
> Cedric
>
>




More information about the Cduce-users mailing list