[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Re: mapping (Was: Re: Re: . in for)

Subject: RE: Re: mapping (Was: Re: Re: . in for)
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Wed, 9 Jan 2002 05:25:16 -0800 (PST)
sumproducts function
"Michael Kay" <michael dot h dot kay at ntlworld dot com> wrote:

> > As I already pointed out in my reply to Dave,
> >
> > >   $departments map lower-case(.)
> >
> > would be ambiguous, as lower-case(.) is a value/string (the
> > result of the
> > application of lower-case() on .
> >
> Actually this syntax is perfectly feasible technically, and isn't far off
> from something I myself proposed at one stage. Given that the data model
> doesn't currently allow functions or expressions as operands to a function,
> all higher-order functionality in XPath 2.0 is currently expressed using
> operators that are built into the language. For example E1/E2 and E1[E2] are
> both higher-order constructs where E2 is evaluated once for each item in E1,
> and it would be quite feasible for (E1 map E2) to work the same way - if
> that's how the WG decided to go. 

The same semantics can be expressed using different syntactic constructs. I am
following the Haskell style, in which brackets and arguments are omitted, if

This results in a considerably more compact and readable expressions.

For example, which of the two function definitions is more readable and

sumProducts($seq) = sum(map(product(), $seq))


sumProduct = sum . (map product)

> The last time it was debated, we decided
> not to go there (Query folks are very attached to their FLWR expressions and
> regard this construct as redundant): but a good argument would still receive
> a hearing.

It seems that the balance is unproportionally shifted towards the Query folks. Why
should this be so? Why it would not be the other way around:

"The last time it was debated, we decided
not to go there (XSLT folks are very attached to their higher-order functions and
regard "the XXX construct" as redundant): but a good argument would still receive
a hearing."

Dimitre Novatchev.

Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.