🦋 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.
00:09 Altai-man joined 00:11 sena_kun left 00:14 Altai-man left 00:20 pecastro left 00:23 aborazmeh joined, aborazmeh left, aborazmeh joined 00:47 aborazmeh left 00:50 frost-lab joined 01:07 MasterDuke left 01:14 aborazmeh joined, aborazmeh left, aborazmeh joined 01:19 Tirifto left 01:35 Doc_Holliwould left 01:48 frost-lab left 01:58 skids left 02:09 molaf left 02:14 vrurg_ is now known as vrurg 02:21 molaf joined 02:34 Black joined 02:35 go|dfish left, Benett left, rjbs joined 02:37 lucasb left 02:38 Black is now known as Benett 02:40 go|dfish joined 02:41 xxpor joined 02:54 xelxebar left 02:56 xelxebar joined 03:34 aborazmeh left 03:41 PavelB left 03:51 _jrjsmrtn left 03:55 __jrjsmrtn__ joined 04:01 xelxebar left, xelxebar joined 04:33 aborazmeh joined, aborazmeh left, aborazmeh joined 05:02 aborazmeh left 06:02 greppable6 left, unicodable6 left, quotable6 left, linkable6 left, coverable6 left, squashable6 left, nativecallable6 left, bloatable6 left, tellable6 left, benchable6 left, bisectable6 left, committable6 left, sourceable6 left, releasable6 left, notable6 left, evalable6 left, shareable6 left, statisfiable6 left 06:03 statisfiable6 joined, coverable6 joined, squashable6 joined, evalable6 joined, notable6 joined 06:04 unicodable6 joined, releasable6 joined, greppable6 joined, bloatable6 joined, sourceable6 joined, linkable6 joined, benchable6 joined 06:05 tellable6 joined, quotable6 joined, bisectable6 joined, shareable6 joined, nativecallable6 joined, committable6 joined 06:10 molaf left 06:20 raku-bridge1 joined, raku-bridge1 left, raku-bridge1 joined 06:21 raku-bridge left, raku-bridge1 is now known as raku-bridge 06:31 bocaneri joined 06:38 jmerelo joined 06:40 bocaneri left, bocaneri joined, bocaneri left 06:41 bocaneri joined 06:47 wamba joined 06:51 parabolize left 06:56 Doc_Holliwould joined 07:27 stanleytam joined 07:32 sjm_uk joined 07:45 stanleytam left 07:52 Altai-man joined 07:56 patrickb joined 08:08 abraxxa joined 08:09 sena_kun joined 08:11 Altai-man left 08:19 Sgeo left 08:20 abraxxa left, domidumont joined 08:34 abraxxa joined 08:39 sno left 08:48 sno joined 08:57 wamba left 08:59 nebuchadnezzar left, nebuchadnezzar joined 09:00 CIAvash left 09:10 lizmat left, lizmat joined 09:19 wamba joined 09:22 veesh_ joined 09:23 veesh left, veesh_ is now known as veesh 09:24 Doc_Holliwould left 09:51 Doc_Holliwould joined 10:05 pecastro joined 10:45 frost-lab joined 11:02 Doc_Holliwould left
patrickb Is it possible to explicitly pass an undefined value as a named argument to a function, so that the function thinks the named wasn't passed (and thus get's defaults applied)? 11:16
tellable6 2020-11-04T18:16:54Z #raku <tony-o> patrickb merged on pluggable. 11:17
lizmat patrickb: no that I know of 11:18
patrickb Reason I ask, I'd like to not state the default again in the following code: sub foo(Bool :$p = False) {} foo(p => $some_external<source> // False); 11:19
11:20 Kaiepi left
lizmat named argument default assignment is basically based on an existskey check 11:21
patrickb Hm. Can one conditionally pass an argument? In Perl one could do `(some => $pair) xx defined $pair` (or so). 11:23
tyil patrickb: when I want to conditionally add arguments to a call, I generally make a hash, and use | to pass it into the sub 11:26
p.tyil.nl/meli like so
patrickb tyil: That's an idea.
tyil though there may be cleaner ways to do this, I'm sure
patrickb tyil: The reason I asked actually is a PR I just submitted for App::Assixt gitlab.com/tyil/perl6-app-assixt/-...equests/15 11:27
I took the easy route though and just added `// False` to the parameter gitlab.com/tyil/perl6-app-assixt/-...220c_90_86 11:28
tyil heh, nice one 11:29
a lot of that code could probably be written a lot better now that I have gotten better at Raku in general :p 11:30
11:31 cpan-raku left
tyil but that MR itself looks good 11:31
11:32 cpan-raku joined, cpan-raku left, cpan-raku joined
patrickb When trying to install Assixt there was another install failure in Config::Parser::toml that I somehow managed to make disappear: gist.github.com/patrickbkr/71dbdec...ec06505f69 11:32
Might be worth to have a look though.
11:33 CIAvash joined
tyil gotta admit, it's been a while since I last did some Raku, but this might be a fun afternoon to get back into writing some code 11:33
I think the Config::Parser::toml issue is fixed in later Config versions, so I'd just need to make Assixt use Config:api<3> 11:34
patrickb Ah, that might explain why the error disappeared after I manually installed the dependencies. 11:35
lizmat is doing some maint on the Rake module 11:36
tyil patrickb: heh, just copied over my old desktop's assixt dir 11:39
and it includes 1 uncommitted change, to update App::Assixt::Config to use $config.set() :p 11:40
patrickb :-P
I beat you to it ;-)
tyil ===> Testing [OK] for App::Assixt:ver<1.0.0>:api<1> 11:46
(from zef install .)
I should probably walk through the docs and update "perl 6" to "raku" as well 11:47
11:59 sftp left
JJAtria[m] O, hi Raku language group on Gitlab 👋 12:01
12:03 xheimlich joined
xheimlich what's the simplest or most popular equivalent of Python's Flask or FastAPI in Python? 12:04
not a web framework but something simple that routes get and post queries to functions. 12:05
maybe something that's commonly used in tandem with a development server like uvicorn.
12:09 Altai-man joined
tadzik xheimlich: cro.services/ probably 12:09
12:11 frost-lab left 12:12 sena_kun left
xheimlich sounds about right. 12:12
the ergonomics of raku for the small things is amazing compared to python. 12:13
maybe fastapi is neater in that it gets to use dataclasses to validate and emit json outputs, and autogenerates a list of routes from the decorated functions. But the latter is something one rarely does for services with two or three entrypoints and the former probably has some idiomatic way of going about it. 12:14
(I'm not about to try and *exactly* reproduce the functionality of python. Loving Raku so far.) 12:15
12:18 sftp joined 12:19 sftp left 12:22 sftp joined
patrickb tyil: Just created another PR with more assixt fixes. 12:24
tyil patrickb: youre on a roll, keep it coming :D 12:25
patrickb nah, I actually just want to use the thing and it keeps throwing errors at me...
how do I turn `$config<runtime><name> = $name;`into a .set equivalent?
tyil $config.set('runtime.name') iirc 12:26
patrickb what about `$config<runtime>{$key} = $value;` ? 12:29
tbrowder hi, all 12:30
patrickb never mind. Kind of obvious...
tbrowder in a grammar that reads an input file, how do i get the line number for a token? 12:31
do i have to count newlines as i proceed? 12:32
moritz you can determine it using the cursor position 12:33
something like $/.prematch.lines.elems give you the current line number
m: say "ab\ncd\nef" ~~ /ef/; say $/.prematch.lines.elems
camelia 「ef」
2
tbrowder ah, that’s the ticket, thanks, moritz! 12:34
moritz ah, that's off-by-one because .lines ignores the trailing newline
tbrowder ok
moritz there should be a working example in Grammar::ErrorReporting 12:35
tbrowder thnx
moritz 1 + $/.prematch.trim-trailing.lines.elems 12:36
should be correct
tbrowder m: say “ab\ncd\n\ef” ~~ /cd/; say $/.prematch.trim-trailing.lines.elems 12:39
camelia 「cd」
1
moritz and you need the 1 + because we usually count lines starting from 1, not 0 12:40
tbrowder probably because it’s zero-indexed as it should be
yes
it all makes perfect sense, i love raku!! 12:41
12:42 abraxxa left 12:50 abraxxa joined 13:12 PavelB joined 13:33 xheimlich left 13:38 xheimlich joined 13:47 ufobat joined 13:59 patrickb left 14:03 jmerelo left 14:06 xheimlich left 14:43 molaf joined 14:47 abraxxa left, abraxxa1 joined 15:23 Sgeo joined
SmokeMachine is there yet a way to get the peer's host/port on a udp "connection" from IO::Socket::Async.bind-udp? 15:25
15:25 parabolize joined 15:26 rindolf joined 15:37 abraxxa1 left 15:45 MilkmanDan left 15:52 MilkmanDan joined 15:57 MilkmanDan left 16:00 Kaiepi joined 16:01 melezhik joined
melezhik .tell patrickb: Config::Parser::toml test OK on Rakudist - rakudist.raku.org/sparky/report/debian/912 , which version of Rakudo do you use? 16:03
tellable6 melezhik, I'll pass your message to patrickb
16:04 MilkmanDan joined 16:08 melezhik left 16:09 sena_kun joined 16:11 Altai-man left 16:18 domidumont left 16:20 MilkmanDan left 16:21 MilkmanDan joined 16:30 wamba left
xinming_ SmokeMachine: do you have plan to add support for table inheritance? 16:36
tellable6 2020-11-04T22:15:17Z #raku <SmokeMachine> xinming_ the first step has been done: github.com/FCO/Red/issues/452
xinming_ SmokeMachine: something like this: paste.debian.net/1170210/ 16:39
16:39 skids joined 16:42 mowcat joined 16:43 skids left 16:46 Black joined 16:48 wamba joined, Benett left
SmokeMachine xinming_: like this or on database? www.irccloud.com/pastebin/g63nHeRV/ 16:49
16:50 Black is now known as Benett 16:51 PavelB left 16:57 Bucciarati left, avar left 16:59 avar joined, avar left, avar joined, Bucciarati joined
SmokeMachine xinming_: yes, that should work... that's a bug 17:01
github.com/FCO/Red/issues/128 17:04
17:06 Bucciarati left 17:07 Bucciarati joined 17:08 domidumont joined 17:27 mowcat left 17:28 mowcat joined 17:40 Doc_Holliwould joined 17:49 Bucciarati left 17:51 Bucciarati joined 17:53 approaching236 joined 17:55 jmerelo joined
jmerelo Here's this unanswered question in StackOverflow, you might want to take a look stackoverflow.com/questions/646842...-raku-to-c 17:57
tellable6 2020-11-06T14:13:46Z #raku-dev <[Coke]> jmerelo - I am @coke on gitlab
jmerelo .tell [Coke] on its way 17:58
tellable6 jmerelo, I'll pass your message to [Coke]
17:59 natrys joined
cpan-raku New module released to CPAN! Rake (0.0.3) by 03ELIZABETH 18:14
18:22 eseyman left
jdv79 theres a resturant named Raku near me. i havent checked it out yet. forgot about it but noticed it while i was "parking" 18:22
18:25 skids joined 18:33 MilkmanDan left 18:35 MilkmanDan joined 18:42 bocaneri left 18:43 gordonfish left 18:51 jmerelo left 19:00 domidumont left 19:05 sjm_uk left 19:13 vrurg left 19:24 ufobat left 19:30 rindolf left 19:34 natrys left 19:35 ape666 joined 19:36 vrurg joined
SmokeMachine m: class A { multi method a(Mu:) {"A"} }; class B is A { multi method a(Mu:) {"B"} }; say B.a # This gives this error 19:39
camelia Ambiguous call to 'a(B: )'; these signatures all match:
(Mu: *%_)
(Mu: *%_)
in block <unit> at <tmp> line 1
SmokeMachine m: class A { multi method a(Mu:) {"A"} }; class B is A { proto method a {*}; multi method a(Mu:) {"B"} }; say B.a # But I can fix like this 19:41
camelia B
SmokeMachine m: class A { multi method a(Mu:) {"A"} }; class B is A {}; B.^add_multi_method: "a", my method (Mu:) {"B"}; B.^compose; say B.a # But how can I fix this case? 19:42
camelia Ambiguous call to 'a(B: )'; these signatures all match:
(Mu: *%_)
(Mu: *%_)
in block <unit> at <tmp> line 1
SmokeMachine m: class A { multi method a(Mu:) {"A"} }; class B is A {}; B.^add_multi_method: "a", my proto method a {*}; B.^add_multi_method: "a", my method (Mu:) {"B"}; B.^compose; say B.a # this doesn't seem to work 19:43
camelia Ambiguous call to 'a(B: )'; these signatures all match:
(Mu: *%_)
(Mu: *%_)
(Mu: *%_)
in block <unit> at <tmp> line 1
19:44 gordonfish joined
SmokeMachine I think I've found it! 19:50
m: class A { multi method a(Mu:) {"A"} }; class B is A {}; B.^add_method: "a", my proto method a {*}; B.^add_multi_method: "a", my method (Mu:) {"B"}; B.^compose; say B.a
camelia B
20:05 MasterDuke joined 20:09 Altai-man joined 20:11 sena_kun left 20:21 MasterDuke left 20:37 MasterDuke joined 20:49 ape667 joined 20:51 patrickb joined 20:52 ape666 left 20:53 eseyman joined 20:54 epony left 20:59 ape667 left 21:00 epony joined 21:05 skids left
[Coke] non raku Q: is there a way to declare a very long string in JSON without having it between a single set of ""'s ? like, I have 100 lines and I'd really like to be able to do "line1\n" + "line2\n" and put real line breaks in. 21:18
... I suppose I can use real newlines in the one very-long-string
21:21 patrickb left
Grinnz yes, literal newlines are valid json 21:26
or i should say, are valid in json strings
just not very common 21:27
actually that may not be true 21:28
moon-child per the json spec, a character is everything from 0x20 to 0x10ffff, except for " and \ 21:35
21:35 squashable6 left
moon-child but I expect most json parsers will accept a literal newline 21:35
Grinnz they don't appear to, which is why i'm second-guessing 21:36
ah right, 0a < 20 21:37
hexadecimal is hard
so no, you can't do that
21:37 MilkmanDan left
Grinnz and no, there's no other way if it needs to stay a single string in the json format 21:38
21:38 MilkmanDan joined, squashable6 joined
Grinnz i wonder if JSONY has a way 21:39
doesn't look like it 21:41
21:50 squashable6 left 21:51 squashable6 joined
[Coke] ew. 22:02
Danke.
if I had control over the reader, I'd make it take a string or an array of strings. ah well
22:11 MasterDuke left 22:24 finsternis joined 22:35 aborazmeh joined, aborazmeh left, aborazmeh joined 23:11 wamba left 23:32 aborazmeh left 23:33 Altai-man left