Re: Keyword arguments and fn:serialize [was fn:slice]

By "doesn't work for fn:serialize" I mean it doesn't solve the usability problems of fn:serialize.

Michael Kay
Saxonica

> On 7 Dec 2020, at 22:45, Dimitre Novatchev <dnovatchev@gmail.com> wrote:
> 
> 
> 
> On Mon, Dec 7, 2020 at 1:42 AM Michael Kay <mike@saxonica.com <mailto:mike@saxonica.com>> wrote:
> 
> .  .  .
>  
> 
> I share your concerns here. This is a good "sanity test" for any changes in this area. As it happens, fn:serialize() has particular complications because the second argument can be either a node or a map (we introduced the ability to supply options using an XML structure before maps were available) and that makes it especially challenging; but if a new call mechanism doesn't work for fn:serialize then I don't think it's worth having.
> 
> 
> @Michael Kay <mailto:mike@saxonica.com> , @Benito van der Zander <mailto:benito@benibela.de> :  The proposed way of defining keyword parameters/arguments (at: https://lists.w3.org/Archives/Public/public-xslt-40/2020Dec/0101.html <https://lists.w3.org/Archives/Public/public-xslt-40/2020Dec/0101.html>) does not require any changes to the way fn:serialize() or any other existing standard function is defined.
> 
> Nothing in it prevents any argument being a map or a record/tuple that contains any wanted number of predefined entries.
> 
> Therefore, the statement that this " call mechanism doesn't work for fn:serialize" is simply not true.
> 
> The proposed way of defining keyword parameters/arguments can be used with an additional "varargs-like" mechanism (if such is really desired) for additionally providing a potentially unlimited number of arguments when calling a particular function.
> 
> This can be similar to the way this is described in the referenced C# document: https://docs.microsoft.com/en-us/dotnet/csharp/methods#parameter-arrays <https://docs.microsoft.com/en-us/dotnet/csharp/methods>
> 
> Or, simply and preferably, have an argument of record/tuple type and define this record/tuple in any wanted way. Why this " doesn't work for fn:serialize"?
> 
> Please, correct your statement.
> 
> There will be coming soon a more concise and formal version of the proposal, so please, send more questions/comments on this in order for them to be reflected in the document.
> 
> Thanks,
> Dimitre
> 
>  
> 
> Michael Kay
> Saxonica
> 
> 

Received on Tuesday, 8 December 2020 00:02:58 UTC