Re: fn:slice()

On Fri, 2020-12-04 at 18:27 +0100, Christian GrĂ¼n wrote:
> How do people feel about the third fn:filter argument that I proposed
> in this thread?

It starts to feel to me as if a syntactic construct would be more in
keeping:

for $matthew in slice of $mark from position = 1 to $john where . mod 2
return $matthew * $luke

Overall i'm fine with {...} representing a block of code (as in Perl,
just as i first encounered a slice operator ("..") in Perl) but
something simple seems to be becoming very complex.

XPath is used standalone, with XQuery and with XSLT, and the target
audiences overlap only slightly i think.

A simpler rule might be that you can always supply *either* positional
arguments *or* named arguments,
    replace(input: ., regex: $pattern, collation: $speaker, $replace-
code: { $2 || $1 })

However, this would require making sure all the functions in F&O had
sensible parameter names instead of item1 and item2 or whatever, as
they'd enter the API.

Supplying options in a map might be done with something like,
    replace(arguments : $map)
where arguments would be a reserved word.




-- 
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:  http://www.fromoldbooks.org

Received on Friday, 4 December 2020 18:02:21 UTC