🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
cpan-raku New module released to CPAN! Sparrowdo (0.1.12) by 03MELEZHIK 01:51
guifa Internally, are there any optimizations if all the givens/when statements are integers or no? 03:36
timotimo not yet 06:20
Geth_ doc/list-rotate: 3688a59670 | (Stoned Elipot)++ | doc/Type/List.pod6
List.rotate returns a Seq since Rakudo 2020.06

ref #3495
While here flesh out a bit the routine description and adopt a more common example style.
06:54
doc: stoned++ created pull request #3688:
List.rotate returns a Seq since Rakudo 2020.06
06:55
Geth_ doc: 7ed6b35e6d | (Stoned Elipot)++ (committed by Juan Julián Merelo Guervós) | doc/Type/List.pod6
List.rotate returns a Seq since Rakudo 2020.06

ref #3495
While here flesh out a bit the routine description and adopt a more common example style.
07:59
linkable6 Link: docs.raku.org/type/List
linkable6 DOC#3495 [open]: github.com/Raku/doc/issues/3495 [checklist][docs] Checklist for 2020.06
andreoss m: subset Book where *.^lookup: 'isbn'; 08:56
camelia ( no output )
andreoss is there a better way to write that? especially if I want to check of method's signature? 08:57
timotimo i believe you can use can or cando for this purpose, though that is probably on a routine rather than a class 08:59
andreoss is it possible to place an anonymous trait somewhere? i.e `where * ~~ role { ... }`? 09:14
timotimo that will not do what you expect :) 09:16
it will match against this exact role, not by shape, but by identity
andreoss thanks. btw, why it's impossible to augment subsets? `subset Book ... { ...more methods here... }` 09:24
timotimo not possible i'm afraid
subsets are really just a matcher on top of an existing class 09:25
all the methods and attributes and such come only from the existing class / type
the matcher only changes how type checks act
andreoss i see, ^add_method does not work either 09:33
but you can call ^add_method inside `where` block, hmm 09:37
timotimo that operates on the whole type of whatever you're passing in 10:01
so if it's the exact class you're subtyping that will get the method, if it's a subclass, that will get the method
cpan-raku New module released to CPAN! Log::Colored (0.1.2) by 03TYIL 10:39
tyil been a while since cpan-raku highlighted me :'D 10:41
lizmat :-) 10:43
tyil jjatria: while I'm here, your RSS feed doesn't include a protocol in the links, which makes it not open the post on my rss reader (nextcloud) 10:44
and lastly
jmerelo: is it intended for the rakudo-star docker image to no longer come with zef? 10:45
(gitlab.com/tyil/perl6-app-assixt/-...3116#L301, zef not found error, goes away when I use a personal image where I'm sure zef is available) 10:46
JJAtria[m] tyil: Ha! Thanks. Well spotted 11:40
I might have to spend some time looking at whatever Jekyll plugin I used for that, but I'm leaning heavily towards moving away from Jekyll entirely at some point, so maybe that is the catalyst? 11:41
tyil my blog is using jekyll too, you can look at that for inspiration if you want to keep using jekyll 11:43
JJAtria[m] tyil: Thanks, I'll take a look. It's definitely going to be faster than "port whole site to different static generator" 11:50
harrison p6: say now - init now; 11:55
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
init used at line 1. Did you mean 'INIT'?
harrison p6: say now - INIT now; 11:56
camelia 0.00110829
harrison say #`foo "bar"; 11:58
p6 say #`foo "bar";
p6: say #`foo "bar";
camelia 5===SORRY!5=== Error while compiling <tmp>
Opening bracket required for #` comment
at <tmp>:1
------> 3say #`7⏏5foo "bar";
harrison p6: say #`(foo) "bar"; 11:59
camelia bar
harrison p6: say #`(foo) "bar" #`(baz); 12:00
camelia bar
harrison p6: say int.WHAT;
camelia (int)
harrison p6: say int ~~ Int;
camelia True
harrison p6: my @a = | 1..3; say @a; 12:02
camelia Potential difficulties:
To apply a Slip flattener to a range, parenthesize the whole range.
(Or parenthesize the whole endpoint expression, if you meant that.)
at <tmp>:1
------> 3my @a = 7⏏5| 1..3; say @a;
[1 2 3]
harrison p6: my @a = | (1..3); say @a;
camelia [1 2 3]
harrison p6: my @a = (1..3); say @a;
camelia [1 2 3]
harrison p6: my @a = R[\] (1..3); say @a;
camelia 5===SORRY!5=== Error while compiling <tmp>
You can't backslash that
at <tmp>:1
------> 3my @a = R[\7⏏5] (1..3); say @a;
expecting any of:
list composer
prefix
term
harrison p6: say [\] (1..3); 12:03
camelia 5===SORRY!5=== Error while compiling <tmp>
You can't backslash that
at <tmp>:1
------> 3say [\7⏏5] (1..3);
expecting any of:
prefix
term
harrison p6: say [] (1..3);
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say []7⏏5 (1..3);
expecting any of:
infix
infix stopper
postfix
statement end
statement modifier…
harrison p6: say [+] (1..3);
camelia 6
harrison p6: say [*] (1..3); 12:03
camelia 6
harrison p6: say "\x0062"; 12:04
camelia b
harrison p6: say "\c[WHITE SMILLING FACE]"; 12:05
camelia 5===SORRY!5=== Error while compiling <tmp>
Unrecognized character name [WHITE SMILLING FACE]
at <tmp>:1
------> 3say "\c[WHITE SMILLING FACE7⏏5]";
harrison p6: say "\c[WHITE SMILING FACE]";
camelia
harrison p6: say ⅒.WHAT; 12:06
camelia (Rat)
harrison p6: say ⅒ * 10;
camelia 1
harrison p6: say ⅒.WHAT.methods; 13:00
camelia No such method 'methods' for invocant of type 'Rat'
in block <unit> at <tmp> line 1
harrison p6: say ⅒.WHAT.^methods; 13:01
camelia (Rat FatRat new nude Num floor ceiling Int Bridge Range isNaN is-prime base base-repeating succ pred norm narrow abs sign conj sqrt rand sin asin cos acos tan atan atan2 sec asec cosec acosec cotan acotan sinh asinh cosh acosh tanh atanh sech asech co…
harrison p6: say (⅒.WHAT.^methods); 13:02
camelia (Rat FatRat new nude Num floor ceiling Int Bridge Range isNaN is-prime base base-repeating succ pred norm narrow abs sign conj sqrt rand sin asin cos acos tan atan atan2 sec asec cosec acosec cotan acotan sinh asinh cosh acosh tanh atanh sech asech co…
harrison p6: (⅒.WHAT.^methods).>>say;
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing dot on method call
at <tmp>:1
------> 3(⅒.WHAT.^methods).>>7⏏5say;
expecting any of:
postfix
harrison p6: (⅒.WHAT.^methods).>>(say);
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of bare "say". In Raku please use: .say if you meant
to call it as a method on $_, or use an explicit invocant or argument,
or use &say to refer to the function as a noun.
at <tmp…
harrison p6: (⅒.WHAT.^methods).>>(&say);
camelia Rat&say
FatRat&say
new&say
nude&say
Num&say
floor&say
ceiling&say
Int&say
Bridge&say
Range&say
isNaN&say
is-prime&say
base&say
base-repeating&say
succ&say
pred&say
norm&say
narrow&say
abs&say
sign&say
conj&say…
lizmat clickbaits rakudoweekly.blog/2020/11/09/2020-...-serviced/
thundergnat m: put Rat.^methods(:local)>>.gist.sort 13:28
camelia ACCEPTS Bool Bridge Complex DUMP FatRat Int Num Numeric Range Rat Real Str Submethod+{is-hidden-from-backtrace}.new WHICH abs acos acosec acosech acosh acotan acotanh asec asech asin asinh atan atan2 atanh base base-repeating ceiling cis conj cos cose…
tellable6 2020-11-05T13:02:10Z #raku <perryprog> thundergnat Thank you!
tib Hello, what are the key features of the Rakudo compiler except being able to compile Raku and precompilation ? I can't find any list (rakudo.org/docs points to the manual page github.com/rakudo/rakudo/blob/master/README.md that does not have this infos). I found this web.archive.org/web/20150801100611/...s/features but it is mainly "Rakudo is able to compile full Raku" (which is already great). Maybe the answer i 14:08
dakkar your message got truncated at "maybe the answer" (IRC doesn't like long messages) 14:11
[Coke] your send cut of at "answer i"
dakkar++
dakkar (also I don't understand the question)
[Coke] Can you give an example of the kind of feature you mean? 14:13
(e.g. from another compiler?)
tib a page like this : www.moarvm.org/features.html but for rakudo
The end of my message was : Maybe the answer is "there is not" 😃 just asking 14:14
dakkar I mean, a compiler… compiles
that's the only thing it does
tib ok, any optims ?
[Coke] Rakudo is implementing the Raku language... so yes, the language features is what you want. 14:15
tib ok, thank you a lot 14:16
[Coke] there's really no other compiler to compare it to at this point if you're looking for "why use rakudo instead of <other compiler>"
guifa timotimo: alright thanks. Trying to improve load times on CLDR — was using given + when ‘longString’ and have cut it down to given + when int. In most cases, it’s under 12 items, so I can probably self-optimize with if/thens, unless arrays of code blocks would be even faster 16:29
MasterDuke m: my $a; $a = do given $_ { when 3 { "three" }; when 5 { "five" }; default { "default" } } for ^1_000_000; say now - INIT now; say $a 16:49
camelia 4.25276669
default
MasterDuke m:
m: my $a; $a = do given $_ { if $_ == 3 { "three" } elsif $_ == 5 { "five" } else { "default" } } for ^1_000_000; say now - INIT now; say $a
camelia 0.7213009
default
guifa MasterDuke: wow, that’s even more a speed reduction that I expected 16:51
guifa hasn’t started writing the new decoding code yet…. have to finish the encoding code 16:52
MasterDuke the `when`s compile to a chain of ACCEPT method calls, the `if`s to a chain of...drumroll please...`if`s 16:53
seems like some optimizations could be possible
guifa MasterDuke: I think the catch is that ~~ is not always the same as eq and ==, so I’m not sure if you can make that assumption 16:55
MasterDuke correct, but i bet something could be done in some cases 16:58
guifa let’s see how this one does 16:59
m: my @options = {“zero”}, {“one”}, {“two”}, {“three”}, {“four”}, {“five”}; my $time = now; my $a; $a = (@options[6.rand.floor] // {"default"})() for 1_000_000; say now - $time; say $a;
camelia 0.00183585
one
guifa wow
err 17:00
I missed a ^
my @options = {“zero”}, {“one”}, {“two”}, {“three”}, {“four”}, {“five”}; my $time = now; my $a; $a = (@options[7] // {"default"})() for ^1_000_000; say now - $time; say $a;
evalable6 0.780211
default
guifa m: my @options = {“zero”}, {“one”}, {“two”}, {“three”}, {“four”}, {“five”}; my $time = now; my $a; $a = (@options[3] // {"default"})() for ^1_000_000; say now - $time; say $a; 17:01
camelia 0.3417322
three
guifa m: my @options = {“zero”}, {“one”}, {“two”}, {“three”}, {“four”}, {“five”}; my $time = now; my $a; $a = (@options[$_] // {"default"})() for ^1_000_000; say now - $time; say $a; 17:03
camelia 1.2759247
default
cpan-raku New module released to CPAN! Test::Async (0.0.16) by 03VRURG 19:39
JJAtria[m] tyil: The feed should be sorted now :D 21:28
tyil JJAtria[m]: cool, thanks!
El_Che !seen patrickbr 21:37
seen patrickbr 21:38
.seen patrickbr
tellable6 El_Che, I haven't seen patrickbr around, did you mean patrickb?
El_Che .seen patrickb
tellable6 El_Che, I saw patrickb 2020-11-06T21:21:02Z in #raku-dev: <patrickb> \o
El_Che .tell patrickb I saw your mention on the github ticket, but I hadn't had the time to read it. Just moved and right away started demolishing walls and rooms on the old place. Tired :) 21:39
tellable6 El_Che, I'll pass your message to patrickb
Geth_ doc/supply-rotate: cd1001227a | (Stoned Elipot)++ | doc/Type/Supply.pod6
Add Supply.rotate
21:46
doc: stoned++ created pull request #3689:
Add Supply.rotate
21:47
MitarashiDango[m Exercism has asked for programming language feature highlights. If anyone has input for Raku it would be appreciated: github.com/exercism/v3/issues/2763 23:23
timotimo hmm. malleable? reactive? (with react/supply/whenever) something with glue, like having Inline::Python and Inline::Perl5 23:42