🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
leont I tend to start with SQLite and then upgrade to PostgreSQL when needed. Turns out SQLite can get one pretty damn far. 01:09
japhb True! 01:24
SmokeMachine Red make it easy to use the json capabilities from both SQLite and Postgres… :) 02:25
guifa I think something is off on heredocs in the current version of rakudo 05:59
guifa Cannot find method 'specialize' on object of type Perl6::Metamodel::GrammarHOW 07:07
any ideas?
Having a bug right before a conference talk is ... less than ideal :(
guifa nm got it 07:14
melezhik could someone recommend template engine (not web oriented ) ? 08:15
nemokosch I don't think any template engine for Raku is actively web-oriented 10:55
librasteve every time I use $ for multiple things I get surprised, I am also surprised by how hard it is to consistently use @ since raku functions are, errr, quite functional (& lazy) and want to give me back a .Seq ... 11:09
^^^ my usual MO when I get this kind of confusion is to post a blog since generally writing the longer story helps me to deconfuse myself ... and hopefully others 11:10
antononcube Well, I am currently working a template engine that is definitely not web oriented. 🙂 12:56
guifa raku.land/zef:guifa/Polyglot::Brainfuck 13:20
a preview to my talk coming up in just a few minutes
melezhik how can I override object stringification method for my class? 13:23
guifa method Str { ... } 13:26
can also be useful to make a different one for type objects and concrete objects 13:27
multi method Str (:U:) { ... }
melezhik thanks
guifa and :D: for concrete
melezhik m: class Foo { method Str () { say "OK" } } ;  my $a = Foo.new; say "$a"; 13:31
camelia OK
True
nemokosch There is also gist for the lolz 13:37
guifa and don't forget about .raku! 14:22
tbrowder__ ref using SQLite for personal data, is Red ready for other module use instead of a hash? 16:26
SmokeMachine tbrowder_: sorry, I didn’t get it, what do you mean? 16:28
gfldex_ m: my $s = 'a b c d e'; say $s ~~ m:nth(*)/\w/; 16:29
camelia 「e」
gfldex_ `nth(*)` looks like an ENODOC 16:30
gfldex it is specced in S05-modifier/counted.t tho 16:31
SmokeMachine What I meant about red and json was this: github.com/FCO/Red/blob/master/t/36-json.t 16:36
tbrowder__: ^^ 16:37
nemokosch :nth is documented under the match method 17:13
xinming_ What are the differences between Array.push and Array.append please? 18:19
jast the difference is described in the docs for append: docs.raku.org/type/Array#method_append 18:21
in short: append tends to flatten things
xinming_ jast: thanks 18:25
Xliff_ . 22:28
vrurg: You around?
vrurg Xliff_: kind of. A little busy. 22:29
Xliff_ vrurg: OK. I think I have a handle on what I want. If I .^add_method to a class, what's the proper way to recompose? <CLASS>.^compose? 22:42
vrurg: Next question - are roles composed into a type before or after candidates are determined and added to the proto method? 22:50
vrurg: Please answer when time allows. 22:51
vrurg: Thanks in advance.
vrurg Xliff_: Yes, .^compose. 23:32
Xliff_ vrurg: Thanks. Didn't work. It appears Method::Also can .^add_method without the need for .^compose. 23:33
vrurg Xliff_: Before. And don't forget that the proto itself has to be determined too as sometimes it's not immediately available.
Xliff_ vrurg: It isn't determined at all during RoleToClass.apply
vrurg You may need to recompose for non-moar backends to update method cache. 23:34
Xliff_ This is moar.
Give it a think when you have some time.
Thanks, again.
vrurg: If I were going to copy @!candidates from one class to another, what would be the nqp to do that? 23:35
Er... one method to another.
vrurg Have you tried intercepting add_multi_method and, say, add a candidate twice, with the original and aliased name?
Xliff_ Tried using a role and it didn't work. 23:36
I may need a base class.
Xliff_ Class.add_multi_method does not fire. 23:41
vrurg: <Role>.add_multi_method doesn't work either
vrurg Xliff_: then you do something wrong. 23:54
Xliff_ vrurg: method add_multi_method { ... } ? 23:55
Or do I need to override a HOW?
vrurg HOW, of course.
Xliff_ How can I override a HOW?
vrurg I'm about to pose a snippet in the issue.
Xliff_ Ah, thanks!
vrurg s/pose/post/
But take into account: it only works for a proto. 23:56
Xliff_ Can you include the nqp example I asked for?
Or at least point me to an example in the existing source tree... 23:57
vrurg Forget about nqp. You do it all in Raku, even though playing with the metamodel. 23:59