🦋 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:11 aborazmeh joined, aborazmeh left, aborazmeh joined 00:13 Kaiepi left 00:16 Kaiepi joined 00:56 Cabanossi left 00:58 Cabanossi joined 01:12 aborazmeh left 01:26 molaf left 01:39 molaf joined 01:40 Xliff left 02:05 Manifest0 left 02:06 Manifest0 joined 02:12 rbt left 02:20 Cabanoss- joined 02:24 Cabanossi left, Cabanoss- is now known as Cabanossi 02:38 poga left 03:22 NODE left 03:23 NODE joined 03:44 KindOne left 03:49 KindOne joined 03:52 brtastic joined 03:57 albongo is now known as albino 04:07 KindTwo joined 04:09 devmikey left, KindOne left 04:11 KindTwo is now known as KindOne 04:30 affaf joined
affaf Hey dudes. Quick question. 04:30
```sub foo(Str $s) { "" };say "this shouldn't run";if (0 == 0){ my Int $x = foo(""); say $x}``` should not type check but why does this work?
Ugh here's a hastebin link hasteb.in/vetoqowe.pl 04:31
04:37 clarjon1 left
affaf As in I still get the print. 04:45
04:53 wamba joined 05:08 clarjon1 joined
timotimo m: sub foo(Str $s --> "") {}; say foo 05:15
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling foo() will never work with declared signature (Str $s --> "")
at <tmp>:1
------> 3sub foo(Str $s --> "") {}; say 7⏏5foo
timotimo m: sub foo(Str $s --> "") {}; say foo("")
timotimo m: sub foo(Str $s --> "") {}; my Int $a = foo("")
camelia Type check failed in assignment to $a; expected Int but got Str ("")
in block <unit> at <tmp> line 1
timotimo m: sub foo(Str $s --> "") {}; my Int $a = foo(""); say "never runs"
camelia Type check failed in assignment to $a; expected Int but got Str ("")
in block <unit> at <tmp> line 1
timotimo m: sub foo(Str $s --> "") {}; say "runs"; my Int $a = foo(""); say "never runs"
camelia runs
Type check failed in assignment to $a; expected Int but got Str ("")
in block <unit> at <tmp> line 1
timotimo that's runtime, too
05:23 xinming left 05:24 xinming joined 05:31 sauvin joined 05:33 brtastic left 05:43 holli__ joined 05:45 affaf left 05:49 gordonfish left 05:51 skids left, aborazmeh joined, aborazmeh left, aborazmeh joined 06:05 brtastic joined 06:18 Sgeo left, stoned75 joined 06:38 JJMerelo joined 06:40 molaf left 06:44 Kaiepi left 06:48 Kaiepi joined 06:52 domidumont joined 07:13 pecastro joined 07:16 soursBot joined 07:17 andrzejku joined 07:18 wamba left
samebchase- Hello, Say I have a hash %h with many keys, and now I want a smaller hash with just the keys a, b. I know I can do %h<a b>:p, but that gives me a list. How do I get a smaller "subset" hash? 07:36
07:37 JJMerelo left 07:38 holli__ left 07:44 chloekek_ joined
samebchase- I would imagine that this is not an encouraged workflow because we don't have structural-sharing... It would allocate a whole new map. 07:52
07:58 JJMerelo joined
MasterDuke m: my %a = %(:1a, :2b, :3c); my %b = %a<b c>:p; dd %a; dd %b 08:02
camelia Hash %a = {:a(1), :b(2), :c(3)}
Hash %b = {:b(2), :c(3)}
08:03 chloekek_ left, tailgate joined
samebchase- woah, let me try that out. The documentation says that "The adverb :p returns a Pair or a List of Pair instead of just the value." 08:08
So it would need to be assigned to a new hash
08:12 soursBot left 08:17 vike1 left
elcaro Another useful feature of the `:p` on hash slices is that it will "collapse" undefined values 08:23
so oyu can fearlessly give a list of keys that may or may not be in the original hash
m: my %h = (:1a :2b :4d); my @k = <a b c>; say %h{@k}; say %h{@k}:p
camelia (1 2 (Any))
(a => 1 b => 2)
elcaro similar to doing a set intersection 08:25
m: say set(<a b d>) ∩ set(<a b c>)
camelia Set(a b)
08:30 soursBot joined 08:35 aluaces left 08:50 sena_kun joined 08:56 vike1 joined 09:00 JJMerelo left 09:11 aborazmeh left 09:15 hacktor left 09:25 raku-bridge left 09:26 cpan-raku left, raku-bridge joined, raku-bridge left, raku-bridge joined, cpan-raku joined, cpan-raku left, cpan-raku joined 09:31 wamba joined 09:34 soursBot left 09:35 soursBot joined 09:40 rindolf joined, kensanata joined 09:44 Geth left, Geth joined 09:45 raku-bridge left 09:46 cpan-raku left 09:47 raku-bridge joined 10:01 cpan-raku joined, cpan-raku left, cpan-raku joined 10:05 wamba left 10:13 lichtkind joined 10:16 kensanata left, Demos[m] left 10:18 chloekek_ joined 10:21 girafe2 left 10:27 girafe joined, Altai-man_ joined 10:30 sena_kun left 10:39 soursBot left 10:58 Black_Ribbon left 10:59 soursBot joined 11:07 El_Che joined
samebchase- thank you MasterDuke and elcaro! 11:13
11:19 holli__ joined
MasterDuke np 11:19
11:24 suman joined
suman github.com/Raku/problem-solving/bl...to-Raku.md 11:28
11:30 soursBot_ joined, soursBot left 11:39 chloekek_ left
uzl[m] .seen jmerelo 11:47
tellable6 uzl[m], I saw jmerelo 2020-05-28T10:07:04Z in #raku-dev: <JJMerelo> jnthn by all means.
uzl[m] .tell jmerelo I think some doc issues that were addressed by respective PRs and could thus be closed. From the top of my head: github.com/Raku/doc/issues/3389 , github.com/Raku/doc/issues/3308 11:50
tellable6 uzl[m], I'll pass your message to JJMerelo
11:51 sarna joined 11:54 holli__ left 12:02 soursBot_ left 12:11 suman left 12:20 soursBot joined 12:26 aluaces joined, aluaces is now known as alberto, alberto is now known as Guest62 12:28 sena_kun joined 12:30 Altai-man_ left 12:46 wamba joined 12:53 leont joined 13:03 aborazmeh joined, aborazmeh left, aborazmeh joined 13:07 konvertex joined
[Coke] I get "type check failed" 13:19
(the code in the bin said "if true, run this code"... so yes, it was going to run. :) 13:21
13:37 andrzejku left 13:40 holli__ joined 13:57 brtastic left, andrzejku joined 14:14 wamba left 14:21 lucasb joined 14:25 sarna left 14:27 Altai-man_ joined 14:29 sena_kun left 14:34 gordonfish joined 14:35 soursBot left, soursBot joined
raku-bridge <Tilwa> I found a broken link on raku.org/community/ : the smoke testing links to smoke.perl6.org/ which is the default nginx page. Is there a working page somewhere or should it be removed ? 14:41
14:53 brtastic joined 14:58 aborazmeh left 15:00 soursBot left 15:03 skids joined 15:07 soursBot joined 15:09 holli__ left
jdv79 Tilwa: there's a link at the bottom of hte page about how to contrib/fix that 15:15
though what the fix would be is unclear
dotdotdot Well, I'll open a github issue later then. Thanks! 15:16
jdv79 i guess that was zoffix so maybe just remove that section...? 15:17
dotdotdot Maybe it could link to rakudist instead? dunno 15:21
15:30 poohman joined
poohman hi 15:30
was trying to use the module XML::Class and was aiming at using a method called from-xml 15:31
it throws an error saying none of the signatures match 15:32
what does the second argument in the signature below stand for
(XML::Class:U: Str $xml, *%_ --> XML::Class)
just to be sure that I was making no typos I generated an xml string using the to-xml method and passed that 15:33
but got the same error
15:34 _jrjsmrtn joined
elcaro this is a class method, as the first parameter is an undefined XML::Class. the second is the $xml string, the third just stores and pairs/named args in the %_ hash 15:34
15:34 __jrjsmrtn__ left
poohman are there three arguments or two? 15:35
elcaro so it looks like it would just be XML::Class.from-xml('<...>')
well.. it's a method, so "first" is the invocant
poohman and what does *%_ mean? 15:36
elcaro it's just an anonymous hash... similar to how we have $_
poohman ok
elcaro m: sub foo($bar, *%_) {say %_}; foo('one', two => 2, :!three) 15:37
camelia {three => False, two => 2}
elcaro just a way to capture any named args
m: sub foo($bar, *%_) {say %_<three>}; foo('one', two => 2, :!three) 15:38
camelia False
poohman ok
15:41 soursBot left
poohman thanks elcaro 15:41
15:41 soursBot joined
elcaro np 15:45
I've not used to module before.. so i'm not sure if i've given correct info 15:46
poohman one more question - XML::Class:U - what does the U here stand for?? undefined? 15:49
MasterDuke yeah, the type object 15:51
poohman ah 15:52
I was all these days forgetting to instantiate it and when I finally remember to do it
I get this
so I dont use new?? 15:53
MasterDuke yeah, then it's like a "class" or "static" method in other languages 15:56
16:06 soursBot left
poohman but I dont understand how one would pull the data into a type object - wont I need a instamtiated object to assign the data I deserialise from the xml 16:07
16:08 chloekek_ joined
timotimo classes with static data store them in the lexical scope of the class body 16:08
16:08 soursBot joined
poohman how would I be able to access them - could you give a smll example 16:09
timotimo you'd need an accessor method
m: class Flob { has $.attribute; my $static-one; my $static-two; method access-one is rw { $static-one }; method read-two { $static-two } }; Flob.new(attribute => 1).raku.say; Flob.access-one = 99; say Flob.access-one; 16:10
camelia Flob.new(attribute => 1)
timotimo m: class Flob { has $.attribute; my $static-one; my $static-two; method access-one is rw { $static-one }; method read-two { $static-two } }; my $inst-one = Flob.new; $inst-one.access-one = 99; say Flob.access-one;
camelia 99
poohman ok - let me look at the example again - maybe I missed the static member part of it 16:12
timotimo i didn't read further up, so i may have missed something 16:13
poohman ok - I see some light now - thanks - need to take a break 16:21
seems like a lot of MOP there
16:23 holli__ joined 16:26 vike1 left 16:28 vike1 joined, sena_kun joined 16:30 Altai-man_ left 16:38 ShimmerFairy left 16:39 ShimmerFairy joined 16:53 domidumont left 16:56 poohman left 17:12 poohman joined 17:15 mahafyi joined, sena_kun left 17:16 sena_kun joined 17:17 stoned75 left 17:19 stoned75 joined
mahafyi i feel somewhat ready to start trying somethings with raku. i was looking at web modules, i can undertsnad the cro architecture but can't do a react redux site. But i understand Uzu, and the template6 / mustache. i am planning to start directly writing html files from raku, with inline javascript as needed. any guidance on starting website with 17:19
17:27 Guest62 is now known as aluaces 17:31 patrickb joined
timotimo the reason why cro uses react/redux is just that it's pleasant to use 17:33
cro can work with any framework as well as frameworkless; there's a template language now, too
17:35 holli__ left
timotimo i haven't looked at uzu at all yet 17:35
17:35 holli__ joined
timotimo oh, and of course cro can use any template engine that spits out any kind of data that is to be delivered to the client 17:35
as well as just writing your html in your code if you like 17:36
HTML::Tag: say HTML::Tag::p.new(:text('This is my paragraph'), :class('pretty')).render; 17:37
Typesafe::HTML: my $html = HTML.new('<p>this will not be quoted</p>'); $html ~= '<p>this will</p>'; 17:38
modules.raku.org/dist/HTML::BoreDO...an:ALLSOPP here you nest calls to a sub called "h" 17:39
modules.raku.org/dist/HTML::Lazy:cpan:SAMGWISE - haven't looked at this one at all yet
mahafyi timotimo : ah ok. so we can just use the cro pipelines to generate content on the flow by directly writing the html files needed. we can make the grammars needed to build links across all sitemap pages. I hadnt seen the Typesafe::HTML :) 17:40
as far as Uzu goes i was thinking just to start with an apache httpd instead for web server. as it provides authentication for users out of the box. 17:41
timotimo well, don't have to "write files" really 17:42
mahafyi how will the user have a html file in the web server then? 17:43
timotimo there doesn't have to be a file for some html to be served 17:44
the server can literally make shit up :)
mahafyi i see. i didn't know about that.
timotimo having to have one file correspond to one URL is probably a thing you are used to from coding with php or cgi scripts directly 17:45
over there you'd often put a .htaccess file that rewrites URLs 17:46
but "web applications" and "web frameworks" just grab the whole request, so you can decide on your owh whether you look at the filesystem, at a database, at a random number generator, at the stars, etc
mahafyi wow. look like i need to understand this whole thing afresh. 17:48
17:59 Xliff joined
Xliff \o 18:00
I'm tryint to print color sequences to the console. I'm doing something like this...
m: print "\033Hello!\033"
camelia ␀33Hello!␀33
Xliff So only the "\0" part is being recognized. What's the proper way to implement this? 18:01
( I hope it isn't chr.... }
mahafyi ah so that how things like Uzu does its 'live reloads' etc, where any content changed in the 'watch' paths immediately shows up in browser.i was wondering about that 18:02
18:02 ctilmes1 joined
Xliff Well... "{ chr(27) }" but is more verbose than I'd like. 18:03
\o ctilmes!
18:06 ctilmes left
[Coke] Xliff: This answers a different question, but have you seen: github.com/tadzik/Terminal-ANSIColor 18:09
Xliff I've not looked deeply into it, no. 18:10
Oh, LOL!\
\e... much better! :)
[Coke] m: print "\0d12" 18:11
camelia ␀d12
[Coke] (nope)
m: print "\c[33]" 18:13
camelia !
[Coke] m: print "\x033"
camelia 3
18:18 KindTwo joined 18:20 KindOne left 18:23 KindTwo is now known as KindOne 18:27 Altai-man_ joined 18:29 sauvin left 18:30 sena_kun left
timotimo m: print "\o033 18:33
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in double quotes; couldn't find final '"' (corresponding starter was at line 1)
at <tmp>:1
------> 3print "\o0337⏏5<EOL>
expecting any of:
argument l…
timotimo m: print "\o033"
18:36 ctilmes1 left 18:37 patrickb left 18:38 picmyk left, picmyk joined, soursBot left 18:39 patrickb joined
[Coke] m: "\o033".uninames.say 18:40
camelia (<control-001B>)
[Coke] timotimo++
timotimo greppable6: \\0\d\d 18:41
greppable6 timotimo, 175 lines, 32 modules: gist.github.com/8d0ca6466379338db3...3ce28ce9c7
18:45 soursBot joined
timotimo not going through all of that now 18:49
the first few i looked at were in readme and pod
18:54 patrickb left 18:56 soursBot left 19:02 soursBot joined 19:07 poohman left 19:08 mahafyi left 19:14 kensanata joined 19:18 soursBot left 19:24 mahafyi joined 19:30 poohman joined 19:31 Altai-man_ left
mahafyi so cro istelf is a webserver, doesn't need something like apache http to serve up web content. and can do secure https connections as well.. 19:36
19:41 hacktor joined, hacktor left 19:45 patrickb joined 19:47 devmikey joined 19:53 [Sno] left 19:56 sno joined
timotimo usually you'd want to have an nginx in front, much like you would with other web frameworks 19:56
let the webserver handle TLS and load balancing, and static file hosting is something nginx is quite fast at 19:57
mahafyi oh ok. just working thru the cro examples now. 20:03
but in the first cro example localhost:20000 says HELLO, and i can't find the word HELLO and how it is served up anywhere in the dir (that was stubbed) files, except there is some binary file that matches. 20:08
timotimo it's not under lib/Routes.rakumod (or .pm6 or whatever)? 20:12
mahafyi pastebin.com/cx2DHFGR this is all i see 20:15
so it shows as a binary file match in lib/.precomp 20:16
timotimo well, what is in lib/Routes.pm6? 20:19
mahafyi oh so sorry, i did a case sensitive grep forgot the -i flag. 20:20
20:20 brtastic left
timotimo ah :) 20:21
it happens
20:22 wamba joined
moon-child I've been playing with the fancy superscripts 20:22
5⁶⁷ is the same as 5 ** 67 -- well and good
plain ⁶ is the same as 6. That means that ⁶⁷⁸ is the same as 6 ** 78, which feels inconsistent and not obvious 20:23
timotimo yeah
m: say 5⁶⁷5⁶
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say 5⁶⁷7⏏055⁶
expecting any of:
infix stopper
statement end
statement modifie…
20:25 mowcat joined
moon-child I think it might be better to straight up outlaw leading superscript. But if not that, then ⁶⁷⁸ should be 678 20:25
20:27 patrickb left
timotimo i'd only outlaw mixing the interpretation of superscript as superscript after a superscript digit 20:29
mahafyi timotimo : thanks - here is a first html page (i slurped a file i downloaded from w3 css) pasteboard.co/JaFe8b7.png 20:32
i suppose its singularly uninteresting to anyone, but i am very happy lol 20:33
20:37 xinming left, xinming joined
mahafyi is there any reason to choose ngnix over apache http (since i have setup apache only so far) 20:42
20:44 Black_Ribbon joined
moon-child timotimo: hmmm. That's probably reasonable 20:44
mahafyi: nginx is faster and simpler. But apache is a totally fine choice. And it shouldn't be hard to switch later on, if you need to
mahafyi moon-child ty 20:45
20:48 cpage left 20:50 cpage joined
mahafyi ok first onto learning Cro::HTTP::Router :) 20:52
20:57 poohman left 21:01 mahafyi left 21:03 bdju left 21:04 bdju joined 21:07 agentzh joined, agentzh left, agentzh joined
moon-child trying to install IO::Socket::Async::SSL gives 'Could not find OpenSSL in: (bunch of paths)' I have openssl installed (obviously). How do I tell the package about it? 21:12
21:19 rindolf left 21:26 mahafyi joined 21:36 mahafyi left 21:46 kensanata left 22:08 foo222 joined, foo222 left 23:07 ToddAndMargo joined
ToddAndMargo Hi All. Over on github.com/tadzik/perl6-Config-INI...ter/README What does he mean "For example usage, see SYNOPSIS in the Pod"? What is a Pod and where do I fid it? 23:08
timotimo github.com/tadzik/perl6-Config-INI...INI.pm#L45 23:09
"POD" used to stand for "plain old documentation" i think? it's a more complex format of comments with things like sections, links between things, formatting, etc 23:10
and it usually lives in a perl module file, usually at the end
raku has a format that's just called "Pod" rather than it being an abbreviation 23:11
it's the format in which the whole raku documentation site's content is written
ToddAndMargo Would that be in his code section? 23:12
Found it. github.com/tadzik/perl6-Config-INI...fig/INI.pm starts at line 45. Thank you! 23:13
23:17 Sgeo joined 23:49 chloekek_ left 23:50 mowcat left 23:53 devmikey left