Re: Sanity check partial function application with default arguments

> On 11 Sep 2015, at 20:51, Abel Braaksma <abel.braaksma@xs4all.nl> wrote:
> 
> I found that in some cases we allowed something like the following (assuming there is a context node):
>  
> let $lang := lang('en', ?)
> return $lang()
>  
> where $lang() defaulted, due to some static pre-evaluation, to the one-argument function of fn:lang. I believe this is an error, is that correct?

Yes, $lang is a function with arity = 1, so $lang() is illegal.
>  
> Likewise, I believe the following is illegal (omitting the default argument in the dynamic function call):
>  
> let $lang := lang#2
> return $lang('en’)

Yes, this is illegal: $lang here has arity = 2.

Michael Kay

>  
> In other words, I think we are in error and we should not expose this behavior where overloads continue to exist in the function items.
>  
> Thanks,
> Abel

Received on Friday, 11 September 2015 21:49:58 UTC