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

2014-08-26 Thread Marc van Grootel
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 argument list to anonymous function > > Hi Rob, Hi Marc, > &

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

2014-08-16 Thread Marc van Grootel
; > >> -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 >&g

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 h

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 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 syntax and the fact you ca

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

2014-08-14 Thread Christian GrĂ¼n
ian > -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 f

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

2014-08-14 Thread Rob Stapper
in xquery. 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 f

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

2014-08-14 Thread Marc van Grootel
>> string-join). >> >> This is not me saying you should not use fold (in fact it is a very >> nice and elegant function), but that you might want to consider the >> performance impact. >> >> Cheers, >> Dirk >> >> On 14/08/14 08:15, Rob Stapper wr

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

2014-08-14 Thread Rob Stapper
>> >> ) >> >> { fold-left( $args >> >>, '' >> >>, $fn >> >>) >> >> } ; >> >> >> >> local:apply( concat#2, $args

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

2014-08-14 Thread Rob Stapper
, $fn > >) > > } ; > > > > local:apply( concat#2, $args) > > > > Van: basex-talk-boun...@mailman.uni-konstanz.de > [mailto:basex-talk-boun...@mailman.uni-konstanz.de] Namens Marc van > Grootel > Verzonden

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

2014-08-14 Thread Marc van Grootel
t;> >> declare variable $args := ('a', 'b', 'c'); >> >> declare function local:apply >> >> ( $fn >> >> , $args >> >> ) >> >> { fold-left( $args >> >>

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

2014-08-13 Thread Dirk Kirsten
> } ; > > > > local:apply( concat#2, $args) > > > > 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:

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

2014-08-13 Thread Rob Stapper
al:apply( concat#2, $args) 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 argument list to anonymous function Hi, I am t

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

2014-08-13 Thread Rob Stapper
argument list to anonymous function Hi, I am trying to call an anonymous function with a variable argument list. Maybe I'm overlooking something within XQuery but I cannot figure out how to do this. This is the code I would like to get working. declare function local:apply($fn,

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

2014-08-13 Thread Rob Stapper
Grootel Verzonden: woensdag 13 augustus 2014 22:16 Aan: BaseX Onderwerp: [basex-talk] Apply variable argument list to anonymous function Hi, I am trying to call an anonymous function with a variable argument list. Maybe I'm overlooking something within XQuery but I cannot figure out h

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 handl

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

2014-08-13 Thread Marc van Grootel
Hi, I am trying to call an anonymous function with a variable argument list. Maybe I'm overlooking something within XQuery but I cannot figure out how to do this. This is the code I would like to get working. declare function local:apply($fn, $args) { $fn($args) }; declare variable $