query in QUIP 1.6

Hi,
I am a newbie.I am trying to run the foll query in Quip v1.6 . The error I am getting is as follows:
----------------------------------------
Encountered “gre” at line 1, column 10.
Was expecting one of:

“*” …


-----------------------------------------



function gre(AnyElement $e) returns integer {
return
sum($e/score/verbal + $e/score/quant + $e/score/anat)
}
for $x in distinct(document(“app_data.xml”)//country)
let $totalapp :=
(
for $c in document(“app_data.xml”)//applicant
where $c/address/country/text()=$x/text()
return $c
)
let $totaladmit :=
(
for $c in $totalapp
where $c/final/text()=“Admit”
return $c
)
return
(
{
{count($totaladmit)} ,{avg(gre($totaladmit))}, $x
}

)


Thanks for help in advance.

-KM

found the error…its working now…

–KM

BTW: why aren’t you using the latest Quip version.
The language of Quip 1.6.1 is rather outdated.
The working group has made a lot of changes
to the draft since then.

Sven Eric