Re: [basex-talk] Apply variable argument list to anonymous function

2014-08-26 Thread Marc van Grootel
: donderdag 14 augustus 2014 8:49 Aan: basex-talk@mailman.uni-konstanz.de Onderwerp: Re: [basex-talk] Apply variable argument list to anonymous function Hi Rob, Hi Marc, As Rob showed, HOF functions are a possible (and I think actually the only way, although I am not sure) way to deal

Re: [basex-talk] Apply variable argument list to anonymous function

2014-08-14 Thread Rob Stapper
Hi Marc, I’m a basex-user but checkout the fold-functions: fold-left(), fold-right. See: http://docs.basex.org/wiki/Higher-Order_Functions_Module Success, Rob Stapper Van: basex-talk-boun...@mailman.uni-konstanz.de [mailto:basex-talk-boun...@mailman.uni-konstanz.de] Namens Marc van

Re: [basex-talk] Apply variable argument list to anonymous function

2014-08-14 Thread Rob Stapper
And, this one: http://docs.basex.org/wiki/Higher-Order_Functions Rob Van: basex-talk-boun...@mailman.uni-konstanz.de [mailto:basex-talk-boun...@mailman.uni-konstanz.de] Namens Marc van Grootel Verzonden: woensdag 13 augustus 2014 22:16 Aan: BaseX Onderwerp: [basex-talk] Apply variable

Re: [basex-talk] Apply variable argument list to anonymous function

2014-08-14 Thread Rob Stapper
Par example: declare variable $args := ('a', 'b', 'c'); declare function local:apply ( $fn , $args ) { fold-left( $args , '' , $fn ) } ; local:apply( concat#2, $args) Van:

Re: [basex-talk] Apply variable argument list to anonymous function

2014-08-14 Thread Dirk Kirsten
Hi Rob, Hi Marc, As Rob showed, HOF functions are a possible (and I think actually the only way, although I am not sure) way to deal with functions like concat, which do expect a variable number of arguments. This is very valid and might be a valid solution. I would just like to add that you

Re: [basex-talk] Apply variable argument list to anonymous function

2014-08-14 Thread Marc van Grootel
Hi Dirk, Rob, I realize now that the example I gave the wrong impression. I am looking for something general. That's why I added the link to the Clojure apply function which has a couple of examples which show what it should do. Glossing over the hof functions in XQuery 3 and the hof module

Re: [basex-talk] Apply variable argument list to anonymous function

2014-08-14 Thread Rob Stapper
;-) Enjoy, Rob -Oorspronkelijk bericht- Van: basex-talk-boun...@mailman.uni-konstanz.de [mailto:basex-talk-boun...@mailman.uni-konstanz.de] Namens Dirk Kirsten Verzonden: donderdag 14 augustus 2014 8:49 Aan: basex-talk@mailman.uni-konstanz.de Onderwerp: Re: [basex-talk] Apply variable

Re: [basex-talk] Apply variable argument list to anonymous function

2014-08-14 Thread Rob Stapper
-talk] Apply variable argument list to anonymous function Hi Dirk, Rob, I realize now that the example I gave the wrong impression. I am looking for something general. That's why I added the link to the Clojure apply function which has a couple of examples which show what it should do. Glossing

Re: [basex-talk] Apply variable argument list to anonymous function

2014-08-14 Thread Marc van Grootel
, Rob -Oorspronkelijk bericht- Van: basex-talk-boun...@mailman.uni-konstanz.de [mailto:basex-talk-boun...@mailman.uni-konstanz.de] Namens Marc van Grootel Verzonden: donderdag 14 augustus 2014 10:13 Aan: Dirk Kirsten CC: BaseX Onderwerp: Re: [basex-talk] Apply variable argument list

Re: [basex-talk] Apply variable argument list to anonymous function

2014-08-14 Thread Rob Stapper
. Success, Rob -Oorspronkelijk bericht- Van: Marc van Grootel [mailto:marc.van.groo...@gmail.com] Verzonden: donderdag 14 augustus 2014 13:42 Aan: Rob Stapper CC: BaseX Onderwerp: Re: [basex-talk] Apply variable argument list to anonymous function Maybe too much context? Sorry for that. I

Re: [basex-talk] Apply variable argument list to anonymous function

2014-08-14 Thread Liam R E Quin
On Thu, 14 Aug 2014 13:42:24 +0200 Marc van Grootel marc.van.groo...@gmail.com wrote: I will try to come up with a simple but representative example this evening. Note, if you are proposing a change to the XQuery languuage itself, the XQuery WG and the XSLT WG are aware of limitations in our

Re: [basex-talk] Apply variable argument list to anonymous function

2014-08-14 Thread Marc van Grootel
Hi all, I've submitted a proposal to the issue tracker for XQuery 3.1. After thinking about it for a while I realized that to me it appears quite feasible to use the 3.1 array type to have something like fn:apply and also keep the current semantics with for example the proposed arrow operator. I

Re: [basex-talk] Apply variable argument list to anonymous function

2014-08-13 Thread Dirk Kirsten
Hi Marc, interesting question! Although I don't actually now the answer, I think there is an easy work-around for this one. Simply use string-join() instead of concat, i.e. declare variable $concat := fn:string-join#1; It will yield the same result. I don't actually know how to properly