[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] [XPath 3.0] How to do partial function application on the min() function?


Subject: Re: [xsl] [XPath 3.0] How to do partial function application on the min() function?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Mon, 29 Oct 2012 22:20:04 +0000

The first argument of min is a sequence, and the second argument is a collation. So you don't want to fix one argument, you want to fix part of one argument.

Try

let $min2 := function($x) { min(($x, 2)) }
return $min2(3)

There is more than one way to skin a cat....

Michael Kay
Saxonica

On 29/10/2012 21:50, Costello, Roger L. wrote:
Hi Folks,

I would like to fix one argument of the min() function to 2 and leave the other argument undefined, thus producing a partially applied function. Then, I would like to give the partially applied function a value. Here's what I tried:

             let $min2 := min((?,2))
             return $min2(3)

I get this error: Unexpected token "?" in path expression

What's the correct way to accomplish this?

/Roger


Current Thread