🦋 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.
Juerd I guess that very indirectly, the infix . is my fault, even :P 00:01
(given the rationale about .= already existing anyway)
(About which timtowtdi said, back in 2004: "Yes, but the fact that you had to change the spacing bothers me") 00:03
I somehow missed until today that \ . was no longer necessary (at least in many cases) 00:04
Xliff Backslashdot? 00:10
Juerd Xliff: It was called the "long dot" 00:28
Xliff: \ plus whitespace is unspace, and with the . it's the long dot. 00:29
Xliff And that did...? 00:32
Juerd \ negates the whitespace that comes after it
Xliff And holy !@(#(*.... Last watchmen was good! 00:33
Oh... so 42\ .say would work?
Juerd Yes. But with method calls the \ is no longer needed.
Xliff What was the point of something like that?
Juerd Because 42 .say was originally invalid, and people wanted to be able to use whitespace to line things up in tables etc 00:34
But \ . didn't really solve that, because its aesthetics kind of defeated the purpose
m: my @foo = 42, 15; say @foo [1] 00:35
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing infix inside []
at <tmp>:1
------> 3my @foo = 42, 15; say @foo [7⏏051]
expecting any of:
bracketed infix
infix
infix stopper
Juerd m: my @foo = 42, 15; say @foo\ [1]
camelia 15
wtwt5237 hey, guys, may I have your suggestions on the best Raku package(s) for handling image (JPG, PNG, etc) reading and writing? 05:51
I want to read an image as a 2d or 3d numeric array, and do some manipulations on it, and then write back into an image 05:52
jmerelo Great functional programming insights with tmtvl today in the Raku Advent Calendar rakuadventcalendar.wordpress.com/2...reduction/ 06:29
abraxxa how can I ignore a self-signed cert with Cro::HTTP::Client? 07:43
the exact error I get is 'Certificate contains no altnames to check host against' from IO::Socket::Async::SSL line 322 07:45
abraxxa see github.com/croservices/cro-http/issues/77 08:07
xinming_ Is it ok to use something like start { react { ... } } ? 08:26
I never tried, Just thought, since I found that react will "pause" the script
El_Che morning 08:34
abraxxa Cro serializes JSON incorrect for me 08:50
a hash with two keys becomes an array with two hashes each containing only a single key 08:51
JSON::Fast does that 08:57
perl.bot doesn't list #raku, only the old #perl6 channels 09:01
is there anything wrong with my syntax? paste.scsys.co.uk/587292
I need a comma after the closing bracket of the single hash so that it becomes an array 09:10
how stupid is that!
regardless if I use [] or () brackets
jnthn Yes, that's the single argument rule 09:19
Same reaosn that [1..10] gives you an array of 10 items, not 1
abraxxa jnthn: doesn't make sense to me as .. is a range operator 09:33
SmokeMachine u: 👩‍👩‍👧‍👦 12:12
unicodable6 SmokeMachine, U+1F469 WOMAN [So] (👩)
SmokeMachine, U+200D ZERO WIDTH JOINER [Cf] ( ‍)
SmokeMachine, 7 characters in total: gist.github.com/093401af4a604cdd6f...4dae6cee8a
Geth doc: f26de212ba | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/control.pod6
Add example of an "is copy" iteration variable
12:17
Geth doc: 11403aff73 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/control.pod6
improve grammar
12:21
Geth doc: 945c37eb93 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/control.pod6
Add note for the unwary
12:40
xkr47 tbrowder, a friend called it a toombstone... :) 14:47
tbrowder xkr47, i'm not fast enough on humor, is that a play on "tomb"? or a typo? 14:49
if you meant 'tombstone' that is ghoulishly funny! 14:50
no, actually, wryly humourous or, perhaps, touchingly warm praise? 14:51
tbrowder xkr47: ^^ 15:05
Doc_Holliwood m: .say for DateTime.new('2019-12-12T12:00:00Z') ... DateTime.new('2019-12-12T12:00:00Z') 16:13
camelia (timeout)2019-12-12T12:00:00Z
2019-12-12T12:00:00Z
2019-12-12T12:00:00Z
2019-12-12T12:00:00Z
2019-12-12T12:00:00Z
2019-12-12T12:00:00Z
2019-12-12T12:00:00Z
2019-12-12T12:00:00Z
2019-12-12T12:00:00Z
2019-12-12T12:00:00Z
2019-12-12T1…
16:13
Doc_Holliwood m: .say for DateTime.new('2019-12-12T12:00:00Z') ... DateTime.new('2019-12-12T15:00:00Z') 16:14
camelia 2019-12-12T12:00:00Z
No such method 'succ' for invocant of type 'DateTime'. Did you mean any of these?
sum
utc

in block <unit> at <tmp> line 1
ben_m Does anyknow know of an Emacs inferior raku mode or a way to make the raku repl work with comint-mode?
Doc_Holliwood m: role UpOneHour { method succ() { self.clone( :hour( self.hour + 1 ) ) } }; .say for (DateTime but UpOneHour).new('2019-12-12T12:00:00Z') ... (DateTime but UpOneHour).new('2019-12-12T16:00:00Z') 16:15
camelia 2019-12-12T12:00:00Z
2019-12-12T13:00:00Z
2019-12-12T14:00:00Z
2019-12-12T15:00:00Z
2019-12-12T16:00:00Z
Doc_Holliwood aha!
gotta love this language. just why does the first expression create a infinity loop when there is no "succ" method 16:16
unless there is something looking at the endpoints, sees they are identical and optimizes to that? 16:17
ben_m Is there an elegant way to check if a loop was exited using `last` or if it looped through completely? 16:32
[Coke] m: ^10 -> $i { say $i; last if $i == 3; CONTROL { dd $_ }} ; say "done" 16:37
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected block in infix position (missing statement control word before the expression?)
at <tmp>:1
------> 3^107⏏5 -> $i { say $i; last if $i == 3; CONTRO
expecting any of:
[Coke] m: for ^10 -> $i { say $i; last if $i == 3; CONTROL { dd $_ }} ; say "done"
camelia 0
CX::Last.new
1
2
3
done
[Coke] ^^
if you try that locally and comment out the "last if..." line you'll see the control block is never invoked.
sena_kun m: for ^10 -> $i { say $i; last if $i == 3; #`( CONTROL { dd $_ } )} ; say "done" 16:40
camelia 0
1
2
3
done
[Coke] You can try to use a "when..." block inside the CONTROL but then you have to be careful to not stop the last from happening.
Note that the output is out of order in my first example due to stderr/stdout interleaving. 16:41
Doc_Holliwood maybe you should mention the block does get triggered on other things as well. such as return, fail, redo, next, last, done, emit, take, warn, proceed and succeed
I would use a flag for that 16:42
ben_m What I'm looking for is basically Python's else clause on a loop 16:43
[Coke] m: for ^10 -> $i { say $i; last if $i==3; CONTROL { when CX::Last { say "last"; last } } }; say "done";
camelia 0
1
2
3
last
done
[Coke] there, there handles last specifically. 16:44
(and orders output correctly)
cspencer hello all! i’m curious is there has been any work done on bindings for either the torch or tensorflow libraries. previously, i’ve used python for some of my deep learning experimentation, but i’d be curious to try it in raku as well 16:45
tadzik ben_m: in my experience the Python's for-else is mostly useful for trying to find something in a list: perhaps it'd be easier to just do that without a loop in your case?
like the .first() method
ben_m Usually, yes. And I can probably restate this problem in a more raku way. What I'm doing is basically `while (something) { if (test) { process_thing; $found = True; last; } } unless $found { process_no_thing }` 16:50
Not iterating through a list in this case 16:51
tadzik hm, I see 16:58
Doc_Holliwood m: multi sub foo($found where $found) { say "process_no_thing" }; multi sub foo($found where !$found) { loop { return if "process_thing" } }; foo( True ); foo( False ); 17:03
camelia process_no_thing
Doc_Holliwood m: multi sub foo($found where $found) { say "process_no_thing" }; multi sub foo($found where !$found) { loop { return if "process_thing" } }; foo( False );
camelia ( no output )
Doc_Holliwood huh
m: multi sub foo($found where $found) { say "process_no_thing" }; multi sub foo($found where not $found) { loop { return if "process_thing" } }; foo( False );
camelia ( no output )
Doc_Holliwood m: multi sub foo($found where $found) { return "process_no_thing" }; multi sub foo($found where not $found) { loop { return "process_thing" if "process_thing" } }; say foo( False ); 17:04
camelia process_thing
Doc_Holliwood m: multi sub foo($found where $found) { return "process_no_thing" }; multi sub foo($found where not $found) { loop { return "process_thing" if "process_thing" } }; say foo( True );
camelia process_no_thing
Doc_Holliwood here we go
ben_m: ^^
ben_m I'm not sure that's what I mean but I'll have another look in a bit 17:28
lizmat forgot to clickbait rakudoweekly.blog/2019/12/02/2019-...ed-advent/ this morning 17:38
AlexDaniel squashable6: status 17:41
squashable6 AlexDaniel, ⚠🍕 Next SQUASHathon in 2 days and ≈10 hours (2019-12-07 UTC-12⌁UTC+20). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
AlexDaniel ben_m: I think this is a fun related read: blogs.perl.org/users/damian_conway/...ratch.html :) 17:49
Geth doc: 5bb0e8c8f9 | timo++ (committed using GitHub Web editor) | doc/Type/IO/Path.pod6
IO::Path.rmdir returns a Failure, not throws an Exception
17:54
ben_m AlexDaniel: thanks, that really is interesting 17:56
AlexDaniel ben_m: I also needed the `else {}` feature a few times, but its use is so rare that I think writing out explicitly what you need is more readable 17:57
ben_m Yeah, I'm just used to raku having elegant solutions for everything so I thought I'd ask :) 17:59
AlexDaniel `.first(…) // ‘default’` is kinda it 18:05
oh no, I'm about to write something ugly 🤢 18:07
.map for its side effect: for gather @foo.map(…) { 18:08
I think there's a spot for me in hell being prepared
Kaiepi .tell jnthn, can you sum up what metaclasses, metaobjects, metamethods, and HOWs are? i need to ensure i'm getting the jargon for the MOP straight for my advent article on the 14th
tellable6 Kaiepi, and I oop! Backtrace: gist.github.com/525cc9776f5452cdb1...7d86a7b7b6
AlexDaniel Kaiepi: one sec I'll fix it 18:09
lizmat Kaiepi: ls src/Perl6/Metamodel/*HOW*
AlexDaniel Kaiepi: can you try again? 18:10
Kaiepi .tell jnthn, can you sum up what metaclasses, metaobjects, metamethods, and HOWs are? i need to ensure i'm getting the jargon for the MOP straight for my advent article on the 14th
tellable6 Kaiepi, I'll pass your message to jnthn
Kaiepi thanks AlexDaniel 18:11
AlexDaniel ah wait, did sena_kun already fix that bug 18:13
AlexDaniel and I simply have to update JSON::Fast 18:14
AlexDaniel .tell Kaiepi test test 18:19
tellable6 AlexDaniel, I'll pass your message to Kaiepi
AlexDaniel Kaiepi: I think that bug is fixed now!
sena_kun++ timotimo++
Kaiepi lizmat, i've read most of those files, but i want to be certain i explain what they are correctly
Kaiepi s/they are/those terms mean/ 18:20
sena_kun AlexDaniel which one, github.com/timo/json_fast/commit/0...33adb08192 ? 18:25
AlexDaniel sena_kun: yep! 18:26
sena_kun ah. $comma_development_process++ and the fact that our docs contain unicode examples++ for this bugfix. :>
AlexDaniel well, I did know about that bug for quite some time 18:27
because people like to send unicode stuff on IRC :D
I was just procrastinating hoping that somebody else will fix it
sena_kun well, your hopes were granted. \o/ 18:28
AlexDaniel heh…
I guess upcoming rakudo releases are in good hands :)
sena_kun: colabti.org/irclogger/irclogger_lo...12-02#l184 18:29
sena_kun: I'm trying to make sourceable a bit more, um, whateverably :) 18:30
you can now give it non-HEAD commits and it also dwims like 50% of the time 18:31
sena_kun AlexDaniel, I am ok with whatever the license, really... How to mention: if it's the license header with this `Copyright Foo Bario <haha@bububu>` thing, then `Alexander Kiryuhin` and the e-mail you can find at my githug profile is ok
AlexDaniel trying to nail the remaining 49% :)
sena_kun: ok, then, maybe consider changing your git config 18:32
guifa AlexDaniel: rereading that article by Damian has me thinking post-rename. The for(;;) structure errors, but given that ; is also a list op,it should be perfectly valid syntax 19:20
p6: my @a = (* + 2; * * 2; * ** 2); for @a { say .(3) }
camelia 5
6
9
guifa p6: for (* + 2; * * 2; * ** 2) { say .(3) }
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of C-style "for (;;)" loop; in Perl 6 please use "loop (;;)"
at <tmp>:1
------> 3for 7⏏5(* + 2; * * 2; * ** 2) { say .(3) }
guifa (it seems to not have any problem with n < 2 or n > 3 whatever blocks, but it does oddly complain that they’re in sink context) 19:24
p6: for (* + 2; * - 2) { say .(3) }
camelia WARNINGS for <tmp>:
5
1
Useless use of "+" in expression "* + 2" in sink context (line 1)
Useless use of "-" in expression "* - 2" in sink context (line 1)
AlexDaniel guifa: hmm github.com/rakudo/rakudo/pull/1188 20:06
johnrd I have a class C that contains a nested class D. how can a method in D access C's attributes? in general, how can a method in D refer to C's "self"? 20:09
if that can't be done I'll find a workaround but I'd still like to know 20:15
sena_kun johnrd there is no such linking, but you can 1)store self of class C in class D, for example 20:17
sena_kun m: class D {...}; class C { has D $.d; has $.hehe = 42; submethod TWEAK { $!d = D.new(c => self) } }; class D { has C $.c; method m { say $!c.hehe; } }; C.new.d.m; 20:22
camelia 42
sena_kun johnrd see ^ 20:22
captain_none_ame hi 21:14
I am searching for a man who will create the most powerfull web framework in Raku
moritz how's the search going, so far? 21:35
lizmat wonders why captain_none_ame would disqualify more than half of the world's population 21:44
guifa AlexDaniel: definitely related, but distinct. loop() needs to have exactly 0 (sans parentheses) or 3 expressions. There’s no real reason to stop for() from having them, other than to avoid perl5isms, though 22:32
AlexDaniel lizmat: could very well be accidental language barrier thing 22:41
AlexDaniel sometimes I write “he” on autopilot (out of habit?), then I punch myself 22:42
veesh could be one of the old fashioned types who uses the male as gender neutral 22:48
or maybe it's 'a man' as in someone who's 'the man'
lots of options
sena_kun I am more interested in "most powerful web framework" part, to be honest. the conditions of the deal make me very curious... 22:49
veesh also difficult if you don't define by what means you're measuring power 22:50
'most expressive'?
can do the most things?
sena_kun if it is something else than "Who is pretty skilled here and has absolutely nothing to do at the same time to write tons of pretty, complex code and squash bugs everywhere and then write even more".
veesh can shoot a kamehaha wave?
i would use a web framework that could go super saiyan any day 22:51
sena_kun ported a flask tutorial to Cro::HTTP and the sources were twice as small, for example
veesh lol 22:52
well, if you cut out all the whitespace, then that's easy
especiallly if it's spaces and not tabs
AlexDaniel sena_kun: niiice 22:56
I'm actually interested in something django-like
sena_kun AlexDaniel, well, django is another matter... It is not minimalism anymore and I don't think cro fits. 22:57
AlexDaniel sena_kun: it surely fits? It's just that a lot more needs to be implemented too 22:59
veesh what's so great about django? I didn't enjoy it when i was learning it 23:13
but then again, that was when i just started programming