🦋 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.
xfix p6: say 2 + 2 * 2; 09:29
camelia 6
xfix i find it interesting that the command is still `p6` when it's not Perl 6 anymore 09:30
raku: say 2 + 2 * 2
evalable6 6
lizmat xfix: we deem backward compatibility to be important :-) 09:32
xfix fair, although the channel topic could be updated
lizmat good poing
*point
lizmat turns out I don't have the rights to do that 09:33
moritz ^^ ?
xfix raku: say Q[@A`DO world!]~|<HeLhg> 09:35
evalable6 Hello world!
moritz 10:40 -ChanServ(ChanServ@services.)- You are not authorized to (de)op moritz on #raku. 09:40
tadzik Anarchy in the IRC :) 09:42
chloekek p6: say ‘Ⓐ’.charss 09:43
camelia No such method 'charss' for invocant of type 'Str'. Did you mean any of these?
chars
chrs

in block <unit> at <tmp> line 1
chloekek p6: say ‘Ⓐ’.chars
camelia 1
chloekek True anarchy: make this return 2. 😈
xfix that's Raku for you, it uses graphemes by default :)
lizmat m: say "😈".uninames 09:44
camelia (SMILING FACE WITH HORNS)
xfix raku: say '🏴‍☠️'.chars
evalable6 1
lizmat m: say "😈".encode
camelia utf8:0x<F0 9F 98 88>
xfix raku: say ‘Ⓐ’.uninames 09:45
evalable6 (CIRCLED LATIN CAPITAL LETTER A)
xfix well, i guess it's a single codepoint too
raku: for my $x (1, 2, 3) { say "This shouldn't compile: $x" } 09:47
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/AhSdzM5SWc
This appears to be Perl code
at /tmp/AhSdzM5SWc:1
------> 03for 08⏏04my $x (1, 2, 3) { say "This shouldn't co
synthmeat what, that's supposed to be emojis combined to jollyroger?
xfix 🏴‍☠️ is a pirate flag
synthmeat nice. TIL.
xfix raku: say '🏴󠁧󠁢󠁷󠁬󠁳󠁿'.chars 09:48
evalable6 1
xfix raku: say '🏴󠁧󠁢󠁷󠁬󠁳󠁿'.encode
evalable6 utf8:0x<F0 9F 8F B4 F3 A0 81 A7 F3 A0 81 A2 F3 A0 81 B7 F3 A0 81 AC F3 A0 81 B3 F3 A0 81 BF>
xfix raku: say '🏴󠁧󠁢󠁷󠁬󠁳󠁿'.uninames 09:49
evalable6 (WAVING BLACK FLAG TAG LATIN SMALL LETTER G TAG LATIN SMALL LETTER B TAG LATIN SMALL LETTER W TAG LATIN SMALL LETTER L TAG LATIN SMALL LETTER S CANCEL TAG)
xfix raku: say join ' ', '🏴󠁧󠁢󠁷󠁬󠁳󠁿'.uninames
evalable6 WAVING BLACK FLAG TAG LATIN SMALL LETTER G TAG LATIN SMALL LETTER B TAG LATIN SMALL LETTER W TAG LATIN SMALL LETTER L TAG LATIN SMALL LETTER S CANCEL TAG
xfix raku: say join ' | ', '🏴󠁧󠁢󠁷󠁬󠁳󠁿'.uninames
evalable6 WAVING BLACK FLAG | TAG LATIN SMALL LETTER G | TAG LATIN SMALL LETTER B | TAG LATIN SMALL LETTER W | TAG LATIN SMALL LETTER L | TAG LATIN SMALL LETTER S | CANCEL TAG
chloekek p6: say(chr(0xE000)) 10:07
camelia
chloekek p6: say(chr(0xE000).uninames) 10:08
camelia (<private-use-E000>)
xfix p6: say chr(0xD800) 10:12
camelia Error encoding UTF-8 string: could not encode Unicode Surrogate codepoint 55296 (0xD800)
in block <unit> at <tmp> line 1
xfix p6: say chr(0xD800).uninames 10:13
camelia (<surrogate-D800>)
xfix p6: say chrs 0xD801, 0xDC37 10:14
camelia Error encoding UTF-8 string: could not encode Unicode Surrogate codepoint 55297 (0xD801)
in block <unit> at <tmp> line 1
kawaii Hi, I'm a little confused about some code I have here. I send some data to a remote API and then use the same API to add some reactions (emojis) to the message - after this I then start a tap on the event supply for the message I created but it's picking up the two add-reaction() events from the first block of code. www.irccloud.com/pastebin/R3ukTWoV/ 11:03
am I misunderstanding something about how `start react` works?
my initial thought was that the event supply was sending historical events, but this isn't the case 11:04
surely since I am `awaiting` that first block of code, there's no way the latter half is running at all, is there? at least not until the first finishes
lizmat is not immediately seeing it, jnthn might 11:05
Altreus I feel better when the grown-ups also can't immediately see what's happening :D 11:06
jnthn kawaii: Certainly all the stuff in the `.then` block will have run before the `react` block is started (and you can probably confirm that by logging something before the `start react` line) 11:07
Altreus here's where the supply happens github.com/shuppet/p6-api-discord/...e.pm6#L150
I'm pretty sure I've used a live supply
jnthn Note that `start react` is "fire and forget", so if that were your full program it'd just exit (I'm guessing it's not) 11:08
Altreus it's not
I haven't hit him with the "post the whole code" learning stick enough yet
I think the tap on the line I just linked to might also be better as a start react whenever ... maybe? 11:10
vague memories of being told only to use a tap if I know I need to use a tap
jnthn Sorry, bit distracted debugging a pathalogical parser backtracking case at $dayjob... 11:18
Altreus fun stuff derailed by real work :( 11:19
story of my career
lizmat reluctantly clickbaits rakudoweekly.blog/2020/03/16/2020-...od-friend/ 15:07
El_Che mm 15:14
it's was a nice text, lizmat 15:17
El_Che is this sarcasm or is it just me: twitter.com/ThePerlShop/status/123...20450?s=20 16:01
Grinnz doesn't seem like it to me? 16:02
El_Che it's me then :) 16:02
and that's a good thing :)
wildtrees to whom it may concern: page docs.raku.org/language/performance needs a s/#perl6/#raku/ :) 16:03
[Coke] doesn't seem like sarcasm to me. Seems like a small factual update. 16:04
El_Che not that there is something wrong with a little sarcasm :)
[Coke] wildtrees: can you open an issue at github.com/Raku/doc/issues? (A pr with updates would be awesome, but an issue helps too)
chloekek Changing the title of a book is probably very difficult. 16:05
It would have to be a completely new book, not just a new print of a book.
El_Che chloekek: I don't think so, but it would require editing inside
chloekek Apparently the author is working on it. 16:06
tbrowder hi, #raku people 16:13
question: is there any way to publish a raku module in our ecosystem that uses a p5 module? 16:14
i.e., can zef install p6 modules from cpan? 16:16
what about dependent linux executables?
s/p6/p5/ 16:17
AlexDaniel tbrowder: you can publish it, zef won't do anything automatically 16:20
tbrowder ok, thnx 16:29
wildtrees m: my @a = (1,2,3) ; say [Z] (@a,@a,@a) ; 16:53
camelia ((1 1 1) (2 2 2) (3 3 3))
lizmat El_Che: it's you
wildtrees you can fold the zip operator over a list of arrays, how nice :)
AlexDaniel wildtrees: not exactly 16:54
AlexDaniel I mean, you can 16:54
but is it nice?
El_Che lizmat: good, like I said above 16:55
wildtrees it's not exactly doing that in the code I passed to camelia bot? 16:56
lizmat El_Che: I just wanted to confirm a good thing :-)
AlexDaniel wildtrees: well, here: 16:58
m: my @a = 1,2,3; my @b = @a,@a,@a; dd @b; say [Z] @b
camelia Array @b = [[1, 2, 3], [1, 2, 3], [1, 2, 3]]
((1 1 1) (2 2 2) (3 3 3))
AlexDaniel m: my @a = 1,2,3; my @b = @a,@a; dd @b; say [Z] @b
camelia Array @b = [[1, 2, 3], [1, 2, 3]]
((1 1) (2 2) (3 3))
AlexDaniel m: my @a = 1,2,3; my @b = @a; dd @b; say [Z] @b
camelia Array @b = [1, 2, 3]
((1 2 3))
AlexDaniel hmmm, hold on, it's the @b itself that is wrong?
ah wait 16:59
m: my @a = 1,2,3; my @b = @a,; dd @b; say [Z] @b
camelia Array @b = [[1, 2, 3],]
((1 2 3))
AlexDaniel there
wildtrees m: my @a = 1,2,3 ; dd @a ; 17:00
camelia Array @a = [1, 2, 3]
wildtrees m: my @a = 1,2,3 ; my @b = @a ; dd @b ; 17:01
camelia Array @b = [1, 2, 3]
AlexDaniel wildtrees: docs.raku.org/language/traps#Using...t_of_lists 17:02
wildtrees: the way [ ] DWIMs is nice but it's a design flaw
you should be alright as long as you know about it though
rypervenche Hmm, I'm guesing that completely changing the cover is too difficult, but I feel that "Raku" should be the main name of the O'Reilly book. I hope to see that in a future version. 17:34
wildtrees m: <a b c>.map: *.say 18:25
camelia a
b
c
wildtrees is there like a foreach or something instead of map when I just want effects but don't care about the return result? like mapM_ from haskell? 18:26
Geth doc: 0116351a5a | (Stoned Elipot)++ | doc/Type/Any.pod6
correct plural form
18:27
linkable6 Link: docs.raku.org/type/Any
jnthn wildtrees: Just use map in a void context, or force the void context by writing `sink <a b c>.map: *.say` 18:28
sena_kun releasable6: status 18:38
releasable6 sena_kun, Next release in ≈11 days and ≈0 hours. 2 blockers. Changelog for this release was not started yet
sena_kun, Details: gist.github.com/ce2c49e3257087346f...8cce920879
hankache hello #raku 19:14
tellable6 2020-02-26T21:10:56Z #raku-dev <rba> hankache: Still like to know what you fixed to build Rakudo Star on Windows. As I'm getting the same error.
hey hankache, you have a message: gist.github.com/414ec05f8d812bc818...3d20d919c5
chloekek Is there a way to get positional arguments into a hash without repeating their names? 19:17
In Perl 5 I could write: my %hash = ( foo => shift, bar => shift ); 19:18
I could do that in Raku but it’d be a variadic function: sub f(*@c) { my %hash = <foo bar> Z @c }. 19:19
Altreus that sounds messy 19:22
You could make a multi function where the positional form calls the named form 19:23
AlexDaniel chloekek: you can still do that if you want 19:25
ah that's what you said in the last message :)
this almost works: 19:26
m: sub f(|c($foo, $bar)) { dd $foo; say c.pairs }; f 42, 50
camelia 42
(0 => 42 1 => 50)
chloekek p6: sub f($foo, $bar) { say MY:: }; f(1, 2) 19:31
camelia PseudoStash.new(($! => Nil, $*DISPATCHER => (Mu), $*NEXT-DISPATCHER => (Mu), $/ => Nil, $_ => (Any), $bar => 2, $foo => 1, $¢ => Nil))
Doc_Holliwood m: sub foo( $bar, $baz ) { my %h = :$bar, :$baz; }; dd foo('BAR', 'BAZ') 19:33
camelia Hash %h = {:bar("BAR"), :baz("BAZ")}
Doc_Holliwood chloekek: this? ^^
AlexDaniel “without repeating their names” :)
chloekek Still have to write the argument names twice, but that’s better than bar => $bar :) 19:34
tadzik well, you can probably still use @_ and shift like in Perl 5, for the most part :) 19:35
tadzik m: sub foo(*@args) { my %h = foo => @args.shift, bar => @args.shift; say %h.perl }; foo('bar', 'baz') 19:36
camelia {:bar("baz"), :foo("bar")}
AlexDaniel m: sub f($foo, $bar) { dd $_ for &?ROUTINE.signature.params }; f 42, 50
camelia Parameter $foo = $foo
Parameter $bar = $bar
tadzik oh that's just lovely AlexDaniel :D
AlexDaniel but then what? Look it up by name in MY:: ?
tadzik it's a good lead
you can eval them :>
Grinnz MY::? /me has ExtUtils::MakeMaker flashbacks 19:37
tadzik OH::MY
hrm, I seem to recall a time when you could declare a sub with no signature and it'd work Perl5 style... do I misremember? 19:39
now it doesn't compile as it assumes the signature is ()
AlexDaniel m: sub f($foo, $bar) { say $_, ‘ – ’, ::(.name) for &?ROUTINE.signature.params }; f 42, 50
camelia $foo – 42
$bar – 50
tadzik AlexDaniel++
AlexDaniel still not a hash though 19:40
but that's much easier to figure out
m: sub f($foo, $bar) { dd &?ROUTINE.signature.params.map({.name => ::(.name)}).hash }; f 42, 50 19:43
camelia Hash % = {("\$bar") => 50, ("\$foo") => 42}
AlexDaniel maybe there's a shorter way
btw I don't know why it puts () around keys
6c: sub f($foo, $bar) { dd &?ROUTINE.signature.params.map({.name => ::(.name)}).hash }; f 42, 50
committable6 AlexDaniel, gist.github.com/d99f4633f7c372e033...07cd8732d6 19:44
AlexDaniel riiiiiight
bisect: sub f($foo, $bar) { dd &?ROUTINE.signature.params.map({.name => ::(.name)}).hash }; f 42, 50
bisectable6 AlexDaniel, Bisecting by output (old=2015.12 new=945a4d8) because on both starting points the exit code is 0
AlexDaniel, bisect log: gist.github.com/50efe65176d9bc8413...53db7e2bdc
AlexDaniel, (2020-01-06) github.com/rakudo/rakudo/commit/08...0c9087c687
AlexDaniel c: 08aec410ef6^,08aec410ef6 ("\$foo") => 42 19:47
committable6 AlexDaniel, ¦08aec410ef6^,08aec41: «WARNINGS for /tmp/5smSwNEVBz:␤Useless use of "=>" in expression "(\"\\$foo\") => 42" in sink context (line 1)␤»
AlexDaniel c: 08aec410ef6^,08aec410ef6 (‘$foo’ => 42).raku.say
committable6 AlexDaniel, ¦08aec410ef6^: «"\$foo" => 42␤» ¦08aec41: «("\$foo") => 42␤»
AlexDaniel R#3555 19:48
linkable6 R#3555 [open]: github.com/rakudo/rakudo/issues/3555 [LTA][regression] pair.raku adds unnecessary parens
wildtrees what does ~= do in raku? 19:55
Altreus x = x ~ y 19:56
same as += except for ~
rouking It looks like the download instructions on raku.org are out of sync with the directory structure on rakudo.org 20:15
the correct link is rakudo.org/dl/star/rakudo-star-2020.01.tar.gz 20:16
The instructions have "downloads" instead of "dl" there 20:17
matiaslina uploaded an image: 2020-03-17-172716_460x236_scrot.png (39KB) < matrix.org/_matrix/media/r0/downlo...ZulWsEXzst > 20:27
AlexDaniel` Matias: heh 21:00
wildtrees how do I check if an instance of an object is a certain class hierarchy or does a certain role at runtime? 21:01
lizmat m: say Int ~~ Numeric 21:02
camelia True
lizmat wildtrees: aka ~~ it 21:02
m: say 42 ~~ Int
camelia True
lizmat m: say 42 ~~ Rat
camelia False
matiaslina AlexDaniel: Oops. Wrong room. 21:03
sry!
AlexDaniel` Matias: surprisingly on IRC it did upload the image :) But of course deletions don't work 21:04
matiaslina Yeah, the bridge sends the public link. Really don't know if irc supports deletion of messages 21:17
lizmat this feels like an interesting problem to fix with a Supply: twitter.com/AlanSwithenbank/status...4734449665 21:41
Grinnz instinctually thinks "show code" 21:43
guifa Let’s say someone wanted to do have a “use Fortran;” statement in a block, and have the entire block evaluated as if it were Fortran. I know how to set up the grammar and actions, but I’m not sure how to set up the slangy part. (I know how to do it if, for instance, it were going to be “fortran { … }”, as there’s a few examples of doing that with, e.g. SQL) 22:36
guifa The P5 model is a bit overwhelming for me to follow 22:36
MasterDuke guifa: i think Slang::Tuxic might be a simple example of doing what you're talking about 22:44
guifa Hmm that just seems to modify a few tokens. Could I go so far as to modify the TOP token? 22:55
MasterDuke i don't actually know, i've never worked with slangs at all 23:35