... upon re-reading my comment that was probably not the construction you were wondering about. I was surprised by the extra level of parentheses as well.
On Thu, Sep 11, 2014 at 4:45 PM, Marc van Grootel < marc.van.grootel@gmail.com> wrote:
Hi Rob,
Well, it's a very nice operator when you start connecting various functions together to form a kind of pipeline.
As the 3.1 draft example shows:
tokenize((normalize-unicode(upper-case($string))),"\s+")
or,
$string=>upper-case()=>normalize-unicode()=>tokenize("\s+")
Which reads better (inside to outside or sequential)? I think the latter. The required ()s even are kind of mnemonic for pipelines (if you squint a little).
"foo" ===>()===()===()===> "FOO"
--Marc
On Thu, Sep 11, 2014 at 3:25 PM, Rob Stapper r.stapper@lijbrandt.nl wrote:
Hi,
I was playing with the arrow-operator and found that it doesn’t work on anonymous functions, see example.
('A', 'B', 'C') => function( $sequence) { count( $sequence)}
No idea why you should use a construction like this but I, kind of, expected it to work.
Maybe something for a next release( together with the “apply-function”;-).
Regards,
Rob Stapper
Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus http://www.avast.com/ actief is.
-- --Marc