🦋 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.
cpan-raku New module released to CPAN! LibXML (0.1.12) by 03WARRINGD 01:34
ToddAndMargo in a "for" loop, what is the syntax for "by 3"? for @x by 3? 05:58
ToddAndMargo anyone on newbie duty? 06:13
AlexDaniel ToddAndMargo: .rotor(3) ? 10:12
tellable6 AlexDaniel, I'll pass your message to ToddAndMargo
Altai-man_ finally has some time for sourceable m/ 10:24
AlexDaniel yaay 10:27
sena_kun m: 42.say 12:58
camelia 42
sena_kun evalable6, 42.say
evalable6 42
cpan-raku New module released to CPAN! Pg::Notify (0.0.4) by 03JSTOWE 13:28
AlexDaniel Altai-man_: haha, that error message :D 14:09
Altai-man_ AlexDaniel, I still think we should provide some stacktrace in case of error though, but not sure how to do it nicely. 14:12
Altai-man_ runs away to do other tasks for today
AlexDaniel Altai-man_: where would the stacktrace come from? 14:13
Altai-man_: I mean, if you just `die`, the bot will gist the full exception and give a link 14:14
but you can also just return any output from the process, it'll also gist it because it's too long
Geth ¦ problem-solving: JJ assigned to AlexDaniel Issue Harassment by another member of the community github.com/perl6/problem-solving/issues/131 16:14
uzl[m] Sad to read about that, JJ. With the fear of misjudging someone, I think ugexe has been forgetting about Raku's mantra of being nice to other people. It's undoubtable that he's quite knowledgeable (and most oftentime right about things) but his way of pointing things out are less than nice, and most likely hurtful, disconcerting and discouraging. 17:20
Geth ¦ problem-solving: lizmat self-assigned Harassment by another member of the community github.com/perl6/problem-solving/issues/131 17:29
¦ problem-solving: lizmat unassigned from AlexDaniel Issue Harassment by another member of the community github.com/perl6/problem-solving/issues/131 17:30
cpan-raku New module released to CPAN! Gnome::GObject (0.15.2) by 03MARTIMM 18:26
cpan-raku New module released to CPAN! Gnome::Gtk3 (0.19.2) by 03MARTIMM 18:42
Xliff .seen moritz 19:16
tellable6 Xliff, I saw moritz 2019-11-22T19:51:18Z in #raku: <moritz> it's going to be a three way marriage: the bot, AlexDaniel and me :D
moritz o/
Xliff \o
moritz++: Do you have any suggestions on the best way to turn this into a proper grammar? github.com/Xliff/p6-GtkPlus/blob/m...r-test.pl6
My biggest problem comes with porting the availability token. 19:17
moritz Xliff: you mean parameterizing it? 19:20
there are two approaches here that could work well
the most obvious is to have a token ad { 'AVAILABLE' | 'DEPRECATED'} 19:21
and if necessary, override this token, either through a mixin or by subclassing
moritz the other option is to always parse both, but add an assertion afterwards that depends on a dynamic variable 19:22
moritz token availability { ( <[A..Z]>+'_' )+? <ad> <?{ $<ad>.Str (elem) @*ALLOWED_STATES }> ... } 19:23
the third approach is to always allow both states, and do some kind of filtering afterwards 19:24
Xliff m: grammar A { TOP { <a> }; rule a { 'b' } }; grammar B does A { rule a { 'b' }; }; for <a b> { my $g = $_ eq 'a' ?? A !! B; say $g.parse($_) } 19:24
camelia 5===SORRY!5=== Error while compiling <tmp>
A is not composable, so B cannot compose it
at <tmp>:1
Xliff m: grammar A { rule TOP { <a> }; rule a { 'b' } }; grammar B does A { rule a { 'b' }; }; for <a b> { my $g = $_ eq 'a' ?? A !! B; say $g.parse($_) }
camelia 5===SORRY!5=== Error while compiling <tmp>
A is not composable, so B cannot compose it
at <tmp>:1
Xliff m: grammar A { rule TOP { <a> }; rule a { 'b' } }; grammar B is A { rule a { 'b' }; }; for <a b> { my $g = $_ eq 'a' ?? A !! B; say $g.parse($_) } 19:25
camelia Nil
「b」
a => 「b」
Xliff m: grammar A { rule TOP { <a> }; rule a { 'a' } }; grammar B is A { rule a { 'b' }; }; for <a b> { my $g = $_ eq 'a' ?? A !! B; say $g.parse($_) }
camelia 「a」
a => 「a」
「b」
a => 「b」
Xliff Why didn't I think of that... :)
++(moritz++)
moritz haven't read my book, eh? :D
Xliff Actually, I was!
Xliff Got up with trying to look at it too literally. 19:26
Wanted to add a parameter to availability to do the logic and got caught up with "expecting 2 parameters only got 1" error.
moritz I think the example I gave in the book was parsing different SQL dialects with subclasses
moritz yes, paramaterization is still too easy to do wrong :( 19:27
Xliff Yeah. Started with the search string "code block" and missed it.
This is much cleaner.
moritz: It's still not quite clear about the variety of code blocks you can have in a regular expression. 19:28
moritz :( 19:29
Xliff There's <{ }>, <?{ }>, ":...;" 19:30
Are you going to release a volume 2?
moritz I don't think so 19:31
it's the worst selling of my 3 "proper" books
Xliff :( 19:32
moritz (but the one I'm most proud of)
Xliff Me too!
Xliff moritz: Ah! The thing "code blocks" missed was Table 4-3. 19:43
Xliff What's the easiest way to re-export symbols? 19:58
Xliff Is there a better way than this? 19:59
www.nntp.perl.org/group/perl.perl6...g3120.html
lizmat sub EXPORT { <&foo &bar &baz>.map( { $_ => ::{$_} ).Map } 20:04
Xliff: off the top of my semi-conscious head
Xliff lizmat: Yeah, I got that from the newsgroup method. 20:05
Xliff Now I am thinking about how I can do that WITHOUT listing the whole sheadload of symbols I have to re-export. 20:05
I'm thinking of adding another trait, but I wonder about the best way to do that. 20:06
lizmat P5builtins uses: %export = MY::.keys.grep( *.starts-with('&') ).map: { $_ => ::($_) };
Xliff lizmat++: Ooh! That's nice!
lizmat and then sub EXPORT { %export }
Xliff Also need it for constants, though.
And classes 20:07
andrzejku hi 20:07
tellable6 2019-11-23T17:26:59Z #perl6 <uzl[m]> andrzejku Make sure to join #raku ;-).
andrzejku thnks
:)
lizmat Xliff: that just means you need a smarter grep :-) 20:08
Xliff lizmat: Or a trait-mod.
Xliff lizmat: Or a trait-mod AND a grep! 20:09
lizmat :-)
Xliff Looking for trait-mod<is>(:$export...) then
lizmat unfortunately, "is export" doesn't attach anything on the object, it just puts stuff in namespaces :-( 20:11
Xliff What's a good parameter to use for a trait-mod<is>(:$re-export!) that will work with constants, classes, enums and subs?
Kaiepi m: use Test; say Test::EXPORT::DEFAULT::.grep(*.key.starts-with: '&').map(*.key)
camelia (&fails-like &done-testing &eval-dies-ok &MONKEY-SEE-NO-EVAL &cmp-ok &isa-ok &use-ok &is &diag &bail-out &can-ok &isnt &is-approx &ok &is_approx &nok &dies-ok &is-deeply &flunk &unlike &skip &plan &does-ok &throws-like &lives-ok &eval-lives-ok &skip-r…
tellable6 2019-11-21T20:42:52Z #raku-dev <nine> Kaiepi: I don't think this is a problem solving issue. It's plain bugs that need fixing and the fix is usually some deconts and hllize. See commit 7bc6e46fbd47d7a3c5d51225348bac756d3b7ff6
Xliff lizmat: My re-export trait will need to.
lizmat Xliff: do you want to re-export all things you've imported, or a subset ? 20:12
Xliff Everything that re-export marks as Re-Exportable 20:12
Xliff But first I need to figure out how to capture everything I want to re-export 20:12
Would Mu work?
lizmat ok, so just reading the keys from EXPORT::DEFAULT won't cut it 20:13
Xliff lizmat: constants and enums won't be listed in EXPORT::DEFAULT?
lizmat do you control the code that you import from ?
Xliff Yes.
lizmat then perhaps create a method that would generate the pairs for exporting inside the code you import from ? 20:14
Xliff Well.... everything but cairo-p6, but if I import that, I should be able to re-export, yes?
lizmat base on its EXPORT::DEFAULT maybe?
Xliff Hmmm...
lizmat you can re-export anything :-)
Xliff OK. So what should my trait-mod:<is> look like? 20:18
Xliff m: role ReExportable {}; multi sub trait-mod:<is>(Mu \var, :$re-export!) { var does ReExportable }; 20:18
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot add tokens of category 'trait-mod'
at <tmp>:1
------> 3eExportable {}; multi sub trait-mod:<is>7⏏5(Mu \var, :$re-export!) { var does ReExp
Xliff m: role ReExportable {}; multi sub trait_mod:<is>(Mu \var, :$re-export!) { var does ReExportable }; 20:19
camelia ( no output )
Xliff m: package ReExport { role ReExportable {}; multi sub trait_mod:<is>(Mu \var, :$re-export!) { var does ReExportable }; }; package B { require ReExport; }; 20:19
camelia Could not find ReExport at line 0 in:
inst#/home/camelia/.perl6
inst#/home/camelia/rakudo-m-inst-1/share/perl6/site
inst#/home/camelia/rakudo-m-inst-1/share/perl6/vendor
inst#/home/camelia/rakudo-m-inst-1/share/perl6/core
Xliff m: package ReExport { role ReExportable {}; multi sub trait_mod:<is>(Mu \var, :$re-export!) { var does ReExportable }; }; package B { require ::(ReExport); }; 20:20
camelia Cannot unbox a type object (ReExport) to a str.
in block <unit> at <tmp> line 1
Xliff m: package ReExport { role ReExportable {}; multi sub trait_mod:<is>(Mu \var, :$re-export!) { var does ReExportable }; }; ReExport.say
camelia (ReExport)
Xliff m: package ReExport { role ReExportable {}; multi sub trait_mod:<is>(Mu \var, :$re-export!) { var does ReExportable }; }; package B { sub a is export is re-export { 'a' }; };
camelia 5===SORRY!5=== Error while compiling <tmp>
Can't use unknown trait 'is' -> 're-export' in a sub declaration.
at <tmp>:1
expecting any of:
rw raw hidden-from-backtrace hidden-from-USAGE pure default
DEPRECATED inlinabl…
Xliff m: package ReExport { role ReExportable {}; multi sub trait_mod:<is> is export (Mu \var, :$re-export!) { var does ReExportable }; }; package B { sub a is export is re-export { 'a' }; }; 20:21
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3e {}; multi sub trait_mod:<is> is export7⏏5 (Mu \var, :$re-export!) { var does ReEx
expecting any of:
new name to be defined
Xliff m: package ReExport { role ReExportable {}; multi sub trait_mod:<is> (Mu \var, :$re-export!) is export { var does ReExportable }; }; package B { sub a is export is re-export { 'a' }; };
camelia 5===SORRY!5=== Error while compiling <tmp>
Can't use unknown trait 'is' -> 're-export' in a sub declaration.
at <tmp>:1
expecting any of:
rw raw hidden-from-backtrace hidden-from-USAGE pure default
DEPRECATED inlinabl…
Xliff m: package ReExport { role ReExportable {}; multi sub trait_mod:<is> (Mu \var, :$re-export!) is export { var does ReExportable }; }; package B { import ReExport; sub a is export is re-export { 'a' }; }; 20:22
camelia 5===SORRY!5=== Error while compiling <tmp>
Can't use unknown trait 'is' -> 're-export' in a sub declaration.
at <tmp>:1
expecting any of:
rw raw hidden-from-backtrace hidden-from-USAGE pure default
DEPRECATED inlinabl…
Xliff So how do I import inlined packages? 20:22
lizmat fully qualified if they are our ? 20:24
Xliff m: our package ReExport { role ReExportable {}; multi sub trait_mod:<is> (Mu \var, :$re-export!) is export { var does ReExportable }; }; package B { sub a is export is re-export { 'a' }; };
camelia 5===SORRY!5=== Error while compiling <tmp>
Can't use unknown trait 'is' -> 're-export' in a sub declaration.
at <tmp>:1
expecting any of:
rw raw hidden-from-backtrace hidden-from-USAGE pure default
DEPRECATED inlinabl…
Xliff :*
lizmat afk again& 20:34
SmokeMachine Xliff: maybe something like this? github.com/FCO/Red/blob/master/lib/Red.pm6#L66 20:57
Xliff SmokeMachine: Will that catch everything? 20:58
constants, enums, classes?
SmokeMachine yes...
Xliff \o/
SmokeMachine++
That will work, for now.
Xliff SmokeMachine: What if I have other exportable modules defined in that same compunit. Will it catch those to, or will I need to use MY::EXPORT::ALL:: 20:59
sena_kun is somehow close to give up on using Red 21:28
sena_kun also encourages SmokeMachine to apply for a grant 21:29
SmokeMachine why give up?? :(
sena_kun SmokeMachine, I am getting errors often even on writing "simple" cases. I think it needs more integration testing (along with bug fixes). 21:31
SmokeMachine sena_kun: yes... it needs a lot of more tests... :( 21:31
sena_kun A simple User.^create call that worked very ok a couple of days ago now gives me "Type check failed in assignment to &; expected Callable but got Mu (Mu) in method get-build at (MetamodelX::Red::Relationship) line 51" and I have no idea what to do. 21:32
sena_kun SmokeMachine, thus I believe that dedicating more paid time on it would be helpful. :) 21:32
SmokeMachine sena_kun: was it working on master and stopped working on join? 21:33
sena_kun SmokeMachine, I am not sure, let me try...
Geth_ perl6.org: f0e8261871 | (Naoum Hankache)++ (committed using GitHub Web editor) | source/whatever/index.html
perl6.nanorc -> raku.nanorc
21:38
Xliff sena_kun: Can you psot some code? 21:39
sena_kun SmokeMachine, on master I am getting another error, `Too many positionals passed; expected 1 or 2 arguments but got 3` for `User.^create: :$username, :password(argon2-hash($password));`
Xliff s/psot/post/
sena_kun Xliff, I'll be in advent post, so I'd like to avoid that, to be honest... I think I'll write it using DBIish for now and then ones who want to re-implement it with Red - you are welcome! 21:39
I have days 2 and 4, and a lot of work to do besides this, so really don't want to risk. :( 21:40
Xliff sena_kun: You are allowed to spoil advent posts when debugging, you know. :)
But I get it.
sena_kun Xliff, well, on 2nd December you can take it and rewrite it. ;)
I'll prepare a nice repo, I think.
Xliff SmokeMachine: Getting this when running the test suite...does GLib::Roles::StaticClass
Oops
sena_kun I hope, heh. 21:41
Xliff t/31-update.t ...................... 1/? Use of Nil in numeric context
in block at /home/home/cbwood/Other Projects/Red/lib/.precomp/6087A65AEA3BA6735341C95869FC5014501AA04B/F2/F2E53992C6FFEDC5DC3B09E6E9D69BBEB965D56B line 1
SmokeMachine sena_kun: sorry for all the troubles... 21:42
SmokeMachine Xliff: really? for me the tests are passing... 21:43
sena_kun SmokeMachine, no problem at all! I hope Red will mature nicely soon. :)
Xliff SmokeMachine: Test passes, just I get that warning consistently
Rakudo version 2019.07.1-463-g1d84c64d6 built on MoarVM version 2019.07.1-314-ga26d7fff8 21:44
SmokeMachine Xliff: yes... that... :( I have forgotten about that... :(
Xliff SmokeMachine: LOL! 21:52
Well, that was a reminder. We all need them from time to time. :) 21:53
SmokeMachine I think I'll not have enough time to publish the join branch before my post date... :( 21:55
Xliff :( 22:01
Best to publish when it's done.
El_Che if the problem is maturity, is't best not to rush and let thing stabelize (2c) 22:02
(I would write the word correctly though)