Guest495 Hi everyone! :) How do I turn this around: 00:18
m: say ['an', 'amazing', 'length', 'test'].sort: *.chars; 00:19
camelia (an test length amazing)
Guest495 I thought this would work:
say sort(*.chars): ['an', 'amazing', 'length', 'test'];
m: say sort(*.chars): ['an', 'amazing', 'length', 'test'];
camelia Ambiguous call to 'sort(WhateverCode)'; these signatures all match:
(&by, +values)
(+values)
in block <unit> at <tmp> line 1
Nemokosch Hello 08:47
first of all, you need to know that routines and mathods are still different things 08:48
first of all, you need to know that routines and methods are still different things
so actually there is no guarantee you can "turn around" everything
second, it seems to me that sort does "exist globally" (maybe because it's a multi-method, I'm not sure) 08:51
but I think your syntax is invalid, plain and siple 08:52
but I think your syntax is invalid, plain and simple
m: say sort(*.chars, ['an', 'amazing', 'length', 'test']); 08:53
the colon plays the role of the paranthesis 08:54
in the first case, you had only one argument so it was equivalent to [].sort(*chars) 08:55
in the second case, though, you have two
the colon is for disambiguation when you want to drop the parantheses; it's used for method calls 08:56
here you could just drop the parantheses
m: say sort *.chars, ['an', 'amazing', 'length', 'test'];
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/11/23/2021-...adler-rip/ 13:30
SmokeMachine m: say sort *.chars, <an amazing length test> 15:01
camelia (an test length amazing)
qorg11 Hello, i began programming in raku some hours ago, which are some good resources? (besides docs.raku.org), if it eans anything i have a lot of experience with perl 20:15
lizmat well, there are several books 20:23
raku.guide 20:24
course.raku.org/essentials/
learnxinyminutes.com/docs/raku/
github.com/LaurentRosenfeld/think_...k_raku.pdf # Think Raku as PDF 20:26
qorg11 thank you! 20:36
lizmat you're welcome
also, if you're coming from Perl. you might be interested in these articles: opensource.com/user_articles/238941/238941 20:37
of course s/Perl 6/Raku :-) 20:38