🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
guifa nine -- you were doing some work on native types, I'll try to find a work around for now, but any ideas? 00:00
00:08 reportable6 left 00:10 reportable6 joined 00:24 dextercd left 00:36 hasrthur left 00:48 cielo joined 00:51 cielo left 00:54 frost joined 01:50 frost left 02:36 MasterDuke left, hasrthur joined 02:40 razetime joined, hasrthur left 03:40 quotable6 left, evalable6 left, bisectable6 left, reportable6 left, linkable6 left, benchable6 left, releasable6 left, sourceable6 left, shareable6 left, bloatable6 left, unicodable6 left, greppable6 left, coverable6 left, statisfiable6 left, tellable6 left, squashable6 left, committable6 left, nativecallable6 left, notable6 left 03:41 bisectable6 joined 03:42 reportable6 joined, bloatable6 joined 03:43 committable6 joined, releasable6 joined, statisfiable6 joined 04:15 razetime left 04:35 euandreh left 04:41 sourceable6 joined 04:42 unicodable6 joined, squashable6 joined, coverable6 joined 04:43 benchable6 joined, notable6 joined, nativecallable6 joined, quotable6 joined 05:43 sourceable6 left, benchable6 left, squashable6 left, coverable6 left, committable6 left, nativecallable6 left, quotable6 left, releasable6 left, bloatable6 left, bisectable6 left, unicodable6 left, statisfiable6 left, reportable6 left, notable6 left 05:44 evalable6 joined, unicodable6 joined, nativecallable6 joined, reportable6 joined 05:45 squashable6 joined 05:46 releasable6 joined, committable6 joined, bloatable6 joined 05:47 coverable6 joined 06:09 reportable6 left, ufobat joined 06:11 mexen joined 06:45 quotable6 joined, notable6 joined 07:11 reportable6 joined 07:19 seednode99 left 07:20 seednode99 joined 07:21 jjido joined 07:23 Garbanzo_ joined 07:28 Garbanzo_ left 07:44 statisfiable6 joined 07:47 bisectable6 joined 07:58 abraxxa joined 08:07 abraxxa left 08:08 abraxxa joined 08:11 Sgeo left 08:17 lichtkind_ joined 08:26 jjido left 08:47 TheAthlete joined 08:52 dakkar joined 09:17 hasrthur joined 09:18 razetime joined 09:32 Skarsnik__ left 09:38 qorg11 left 09:41 tellable6 joined, qorg11 joined 09:42 linkable6 joined 09:44 sourceable6 joined 09:46 benchable6 joined 10:15 razetime left 10:26 TheAthlete left 10:42 shareable6 joined, greppable6 joined 11:31 hasrthur left 11:32 hasrthur joined 11:37 Altai-man joined 12:04 jjido joined 12:08 reportable6 left 12:09 reportable6 joined 12:10 frost joined
Nemokosch umm, for the weekly challenge... 12:12
> Given a number base, derive the largest perfect square with no repeated digits and return it as a string. (For base>10, use ‘A’..‘Z’.)
are we expected to find fast enough solutions for large bases? the possible values grow exponentially 12:13
if you take the square root of a 36-digit number, that's still a humonguous 18-digit number 12:14
lizmat And yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2022/01/24/2022-...ned-merge/ 12:20
12:50 frost left
El_Che my failing test for rhel7 and derivatives is because redhat doest not have arm64 images vor 7, only 8 :) 12:55
13:03 frost joined, TheAthlete joined 13:17 ufobat left 13:20 euandreh joined 13:52 discord-raku-bot left 13:53 discord-raku-bot joined 14:01 zmoment joined 14:05 morte_ joined 14:09 frost left 14:12 frost joined 14:34 morte_ left, morte_ joined 14:50 clarjon_1 joined 14:54 clarjon1 left 15:06 Sgeo joined 15:09 Garbanzo_ joined 15:24 jjido left 15:31 Garbanzo_ left 15:32 frost left 15:34 razetime joined
guifa lizmat++ 15:36
15:44 silug left 15:49 silug joined 15:54 qorg11 left 15:55 qorg11 joined
leont «Could not instantiate role 'Class::Name': lang-call cannot invoke object of type 'VMNull' belonging to no language» 15:56
That sounds like I discovered an interesting issue?
16:13 morte_ left
Voldenet Could be that you only discovered horrible message though 16:21
16:21 razetime left 16:37 sena_kun_ joined, Altai-man left 16:44 andinus joined
andinus can i make cro respond to both 'page' and 'page/' ? 16:45
note the '/'
ugexe one option would be to use a middleware to normalize the trailing / one way or another 16:50
16:54 razetime joined 16:56 lichtkind__ joined 16:59 lichtkind_ left 17:00 razetime left 17:09 zmoment left 17:17 silug left
Voldenet maybe not a cool solution, but 17:33
> sub ok { content 'text/plain', 'Ok' }; my $application = route { get -> 'page', { ok }; get -> 'page', '' { ok }}
17:35 dakkar left 17:49 abraxxa left 17:56 silug joined, Altai-man joined 17:57 djerius left, djerius joined 17:58 sena_kun_ left 18:06 reportable6 left, reportable6 joined 18:26 Altai-man left 18:29 jjido joined 18:30 simcop2387 left, perlbot left
gfldex lolibloggedalittle: gfldex.wordpress.com/2022/01/24/it...e-golfing/ 18:46
leont andinus: generally speaking, you do not want to do that. Any relative URL in such a page will point to a different location depending on the presence of the slash or not 18:47
[Coke] might be better to have a redirect. 18:48
leont Exactly, that's generally the better idea.
[Coke] then the final page will act consistently for relative urls
leont I'd personally make the slashless version canonical, but that's entirely personal taste. Either option is fine, just be consistent 18:49
Another problem with aliasing them is that it's cache unfriendly
Because as far as caches are concerned, they're different URLs 18:50
andinus ugexe: i see, ya that would work 18:51
Voldenet: iasked it in #cro, - the middleware solution - paste.debian.net/hidden/ff0cb0f2/
leont: i see, that makes sense, i'll setup a redirect then 18:53
19:02 jjido left
SmokeMachine I was wondering… would that be possible/make sense to @ sigiled arguments of functions become Tuple? 19:07
[Coke] I don't think you can change what the default @ means. 19:12
You could specifically type things Tuple if you wanted.
leont Is there a less annoying way to turn a number into a bigendian encoded Buf than «my $b = Buf.new; $b.write-uint16(0, 1234, BigEndian);» 19:16
It seems like that shouldn't take two statement
[Coke] ... Buf.new.writ.... 19:17
which isn't helpful, but is one statement. :)
leont write-* return Nil, so it's useless 19:18
[Coke] I don't think there's a shorter way, no
SmokeMachine We can change what’s the default smile… shouldn’t we be able to change the default class for a sigil? Making Tuple the default for @ on function args would make simple to people understanding this: stackoverflow.com/questions/707794...rs-are-not 19:29
lizmat SmokeMachine: there have been several problem solving issues about that already 19:31
Personally, I think we need to revisit the whole picture for either 6.e or 6.f 19:32
19:34 lizmat left 19:37 lichtkind__ left
SmokeMachine Agree… but if we are adding an “immutable list” in core, that would be a great chance “fix the inconsistency” 19:38
19:52 simcop2387 joined 19:53 perlbot joined 19:56 Garbanzo_ joined
thundergnat I stumbled across (typoed actually,) a bit of syntax I never saw before and was more than a little surprised it gave the answer I was looking for. 20:06
m: for 1..5 { say .$ } 20:07
camelia 1
thundergnat I don't believe I have ever seen .$ as an alias for $_ before.
I assume I shouldn't rely on it... Or have I just been blind and never noticed before that was legal? 20:08
Voldenet bisect: for 1..5 { say .$ } 20:11
bisectable6 Voldenet, Will bisect the whole range automagically because no endpoints were provided, hang tight
Voldenet, Output on all releases: gist.github.com/00bbc945017ed8f658...44f876be6f
Voldenet, Bisecting by exit code (old=2020.11 new=2020.12). Old exit code: 1
Voldenet, bisect log: gist.github.com/cffac309e8c73e4775...87507c2a37
Voldenet, (2020-12-08) github.com/rakudo/rakudo/commit/79...0f7bdc46f6
Voldenet, Bisecting by output (old=2016.04 new=2016.05) because on both starting points the exit code is 1
Voldenet, bisect log: gist.github.com/e2c87e33e27bce5310...f90fe01928 20:12
Voldenet, (2016-05-12) github.com/rakudo/rakudo/commit/33...d4efe221de
Voldenet, Output on all releases and bisected commits: gist.github.com/cb9400ed951849ed0e...61d5a3fd03
Voldenet as you can see, it wasn't always like that
ugexe m: say Any.$; 20:14
camelia (Any)
ugexe m: say Any.@;
camelia No such method 'CALL-ME' for invocant of type 'Array'
in block <unit> at <tmp> line 1
ugexe shrugs
Voldenet m: for 1..5 { say $_.$ } 20:15
camelia 1
thundergnat Kind of a weird Easter egg rather than legal syntax I guess.
Voldenet m: for 1..5 { say $_.Any } 20:16
camelia No such method 'Any' for invocant of type 'Int'. Did you mean 'any'?
in block <unit> at <tmp> line 1
Voldenet most puzzling, I'm sure it's because `$` is Any 20:17
m: for 1..5 { say $_.(Any) }
camelia No such method 'CALL-ME' for invocant of type 'Int'
in block <unit> at <tmp> line 1
20:22 lichtkind joined 20:23 lichtkind left 20:31 lizmat joined 20:46 TheAthlete left 21:06 jjido joined 21:16 Manifest0 left 21:18 Manifest0 joined
japhb m: with (1,2,3,4) { dd; dd .$ } 21:41
camelia block (;; $_ is raw)
(1, 2, 3, 4)
japhb m: with (1,2,3,4) { dd $_; dd .$ }
camelia (1, 2, 3, 4)
(1, 2, 3, 4)
21:54 younder joined
younder I have problems with Compress:Zlib. I have a file in iso-latin1 and when it encounters a 8 bit character it goes into a infinate loop. 21:58
I eventually gave up copied the file and unzipped it in the local directory. 21:59
anyhow: 22:01
Uploaded file: uploads.kiwiirc.com/files/bb6a47ac...pasted.txt
Uploaded file: uploads.kiwiirc.com/files/756063a9...pasted.txt 22:02
22:02 MasterDuke joined
younder "$line.encode("utf8").bytes == $line.chars" was needed to to filer ascii from iso-latin1 22:05
That took a lot of time to figure out.. 22:06
s/filer/filter/ 22:08
Anyhow what is the story of 'leave' not implemented yet. Would be more belivable if it didn't work :) 22:14
22:15 Garbanzo_ left
younder As i see it C(continue, break) -> raku(next, leave) 22:17
MasterDuke last is break
moon-child leave, not last?
leave is return from blocks, I think, and still nyi 22:18
younder That explains a lot.. 22:19
I thoght leave was like a goto where you jumped out of blocks except that you spesify the exit symbol before the nested loop rather than after. So leave without a symbol would be exit just the innermost loop. 22:24
guifa it's most commonly used in subs as a sort of cleanup-ish thing 22:25
younder yes. 22:26
guifa m: sub calculate-something { LEAVE say 'finished calculations'; return 'here are calculations' }; calculate-something()
camelia finished calculations
moon-child well no leave is different from LEAVE 22:27
younder of cource you have lEAVE to that or try {} CATCH {}.. there are many ways to do things
yes, the all caps versions confused me. What is the difference? 22:28
LEAVE { 22:30
        close $file;
moon-child LEAVE is a phaser. leave is a not-yet-implemented directive which is similar to return except that it escapes blocks rather than subroutines 22:31
younder I sort of got that from working with the code. 22:33
Sorry to trouble you with a beginner like me, but the raku-beginner has practically no attendants. 22:35
22:37 jjido left
younder Why do you call it a phaser? 22:38
moon-child I don't know why they're called that. But see docs.raku.org/language/phasers 22:39
22:39 xinming left 22:41 xinming joined
younder So raku has no character type, just string?  I needed a 'for $word.split('', :skip-empty) -> $ch {' .. to itterate over characters. 22:45
and a integer.chr returns a string 22:46
moon-child do you perhaps want comb? 22:47
m: .say for "quux".comb
camelia q
younder perhaps like a 'go' rune..
moon-child 'rune' is not well-defined given unicode 22:48
younder nor is character
moon-child yes
(or, rather, it is well-defined but not to anything interesting)
again: comb probably does what you want here
younder Yes from the doc comb seems what I was after. thanks! 22:50
Is comb more efficent than .split('', :skip-empty)? 22:52
22:52 xinming left, xinming joined
moon-child seems so 22:53
I would not worry too much about it though
younder replaced it and it works.. 22:55
MasterDuke on a 50k line file, i get ~0.34s for comb()ing every line and ~0.45s for split()ting every line 22:57
22:58 SqrtNegInf joined
younder Another thing I miss Python's 'x in [array] is there a better way than 'grep { $ch eq $_ }, @guessed'? 23:06
moon-child x (elem) array or x ∊ array
younder thanks 23:07
23:08 xinming left 23:09 xinming joined
younder  '$ch (elem) @guessed' works.. 23:12
Well I have learned a lot. Thanks for your time. 23:13
23:14 younder left 23:24 sena_kun left 23:27 xinming left 23:28 xinming joined
elcaro .tell younder Phasers are contructs than can "fire" (get triggered) outside of the standard flow control. The ALLCAPS are to make them stand out because of this 23:49
tellable6 elcaro, I'll pass your message to younder
elcaro .tell younder eg. and INIT block at the bottom of your script doesn't happen last... or you could have a single CATCH block handle _all_ exceptions in a script. 23:50
tellable6 elcaro, I'll pass your message to younder
23:50 sena_kun joined 23:59 hasrthur left