RE: review of "Evaluating Function Calls"

> >Because maps and arrays are functions, one can presumably perform partial
> >function application on them (though I think it would not generally be
> >useful). Is the resulting function a map/array? E.g., consider:
> >     let $m := map {"Su": "Sunday"} return ($m(?)) ? "Su"
> >Does the lookup return "Sunday", or does it raise a type error? I don't
> >think 3.1.5.1 gives a clear answer.
> 
> 
> Good point.
> 
> I agree that it isnĀ¹t terribly useful to create maps or arrays as the
> result of partial function application, but supporting it would be less
> surprising than not supporting it. It would require more test cases.
> 
> 

Alternatively, a more orthogonal solution may be to let the lookup operators allow to operate on function items as context item, but this would require to remove the "If the context item is not a map or an array, a type error is raised" from 3.11.3.1, and possibly modifying the rules here.

Cheers,
Abel

Received on Tuesday, 19 April 2016 15:10:24 UTC