🦋 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.
Xliff tony-o: I've updated the REPL.IT to show the error. 00:01
xinming_ SmokeMachine: I just backlog'ed, and I lost the answer, how do we temp the table name, Could you please answer it again? thanks. 04:33
SmokeMachine: Now, I need to resolve a problem, where multiple views are created and I need to select views(tables) based on selection. 04:34
SmokeMachine: Also, How do we do group by in Red?
SmokeMachine xinming_: `is temp`?
xinming_: what’s the query you want? 04:35
xinming_ SmokeMachine: Not temp table
I mean, change the table name dynamically for the model 04:36
SmokeMachine .^table = “new-name”
xinming_ SmokeMachine: Somethign like; SELECT c1, c2, c3, COUNT(*) FROM tb1 JOIN tb2 ON tb1.id = tb2.id GROUP BY tb1.c1, tb1.c2, tb2.c1 04:37
SmokeMachine: Thanks.
SmokeMachine: I grepd the source, it doesn't seem to have clear example on doing group-by thing correctly.
especially involes .join-table + .group-by, I don't think distinct will work either. ;-) 04:38
SmokeMachine xinming_: yes... I don’t think there is a way of doing that by now...
xinming_: a way of grouping is using classify... 04:40
xinming_: maybe a .classify using Red::AST::Function... 04:44
xinming_: something like: `... .classify: { .c1, .c2, Tb2.c1 }, :as{ .c1, .c2, Tb2.c1, Red::AST::Function.new: :func<COUNT>, :args<*> }` # not tested code 04:49
xinming_ SmokeMachine: BTW, is it possible to specify columns to fetch for a model? 04:50
SmokeMachine: With views, if we don't include the column some data won't be calculated
in DBIC, We have .search(..., { columns => [qw()] }) thing 04:51
SmokeMachine: I think, if Red can fill all these needs, It'll be the killer ORM in raku. ;-)
SmokeMachine xinming_: in Red you can just return the wanted columns... 04:52
xinming_: `Model.map: { .col1, .col2 }` will only “calculate” those 2 columns 04:54
xinming_: is that what you wanted? 04:56
xinming_ SmokeMachine: Nope, What I mean is, returns the whole object, but will die when we try to access unfetched columns 04:58
It's the same as normal model objects, but partially filled.
my @rows = Modle.^all(:columns[<c1 c2 c3>]);
This way, the ResultSeq will be kept, we also have the whole object, with speed. 04:59
BTW, the is-rsclass doesn't work. I'll record these, when you back to computer, We'll discuss those. :-) 05:00
SmokeMachine That’s a good idea... 05:01
Please, open a new issue, I’ll take a look on the is rs-class ASAP 05:02
xinming_ `temp Model.^table = "new-name"` will return error: Can only use 'temp' on a container 05:03
SmokeMachine xinming_: But do you think that should die when accessing a not fetched param? Why not fetching it on the fly? 05:04
xinming_ SmokeMachine: Because that hides too many things underneath, When people specify columns, They know what they are doing, So dying is sensible behavior. 05:05
automaticallly fetching will cause tons of automatically fetch underneath, where, when people uses column limit to enforce the "limit", We shouldn't too smart on this.
SmokeMachine xinming_: colabti.org/irclogger/irclogger_lo...10-31#l190 05:08
xinming_: that makes sense... but maybe add a :fetch option for the case you change your mind and want to fetch that... 05:10
xinming_ SmokeMachine: what irclogs should I check? 05:12
SmokeMachine Sorry, wrong link... let me search for that again... 05:14
tony-o .tell xliff the problem with your updated gist is your rule. it tries to parse that as a code block rather than matching your sym. i wouldn't be surprised if the infix ~~ is also screwing with it in some way. altering it to just find a matching '{' '}' without the before works for me (and is more sane than requiring it to be EOL/EOS) 05:16
tellable6 tony-o, I'll pass your message to Xliff
SmokeMachine I meant this one: colabti.org/irclogger/irclogger_lo...10-31#l190 05:17
xinming_ SmokeMachine: Is the log answer to `temp Model^.table = "new-table"` name? 05:45
SmokeMachine Yes 05:56
Sorry, I can’t try it out with out my computer, but I tried to search on the logs to find how to do that... 05:57
Does anyone knows if something automatic is running more than 100 tests on Red in less than 6 hours? 06:09
usercontent.irccloud-cdn.com/file/...654180.JPG
I’m getting this on Red tests:
And it seems to be this: www.docker.com/increase-rate-limit...tm_budget= 06:10
Odd... does any one know anything about that? 06:11
xinming_ SmokeMachine: ^alias is different from `temp Model.^table = "abc"`; where ^alias("") will set the value permanently, where temp auto restore the old value. 06:25
andrzejku Hi 08:30
do you think perl7 will kill raku?
gfldex_ andrzejku: will javascript kill rust? 08:33
moon-child andrzejku: I don't think there was ever any chance of that. More interesting, though, is perl11/potion (though I think that with _why gone development has stagnated...a decade ago) 08:36
Geth doc: a9fb2a6965 | (Stoned Elipot)++ | doc/Language/statement-prefixes.pod6
Fix link
09:02
linkable6 Link: docs.raku.org/language/statement-prefixes
gfldex lolibloggedalittle: gfldex.wordpress.com/2021/01/03/in...direction/ 09:42
Geth doc: 00d210fa15 | (Brian Duggan)++ (committed using GitHub Web editor) | doc/Language/pod.pod6
Update pod.pod6

Fix space (this currently renders as "Raku&nbsp;modules")
12:50
linkable6 Link: docs.raku.org/language/pod
xinming_ SmokeMachine: I also have other ideas, that I think should allow user to generate table name on the fly. As table expression is also usefull. 13:10
in postgresql, user can run sql functions to generate a table with arg. 13:11
SmokeMachine xinming_: any suggestion for the syntax? 13:18
xinming_ Nope, Buut will think about it. :-) 13:19
SmokeMachine xinming_: I’m also planning to add some new stuff on Red... I’m planning adding .^update-supply, .^create-supply and .^aggregation-supply. All of them will receive Supplies... 13:20
And the .^aggregation-supply will also receive a Callable 13:21
xinming_ SmokeMachine: BTW, can we have a temp sollution to make `temp Model.^table = "new-name"` work? 13:22
SmokeMachine That way it would be easy to “summarise” a supply on a db...
xinming_ SmokeMachine: What are these supplies used for?
I mean, after user create the row? the Supply will have things? 13:23
SmokeMachine xinming_: so if your code, for example, is a Kafka consumer, you can easily put that on a db to easily access that... 13:24
xinming_ Now, `temp Model.^table = "blabla"` will raise error:
Can only use 'temp' on a container 13:25
SmokeMachine xinming_: not, the opposite... the supply will populate the database...
xinming_ I also tried `Model.table = "blabla"`, I got error, Cannot modify an immutable Str (table_name_provided)
SmokeMachine: not that clear to me ATM. :-) 13:26
SmokeMachine xinming_: a supply with the changes on the database we already have with .events 13:27
xinming_ I read in MetamodelX/Red/Model.pm6, the table method is rw.
SmokeMachine xinming_: why the .^alias haven’t done the trick? 13:28
xinming_ I just can't figure it out, why it'll be the string.
xinming_ SmokeMachine: What does .^alias do? 13:29
SmokeMachine xinming_: created a new model based on the given one
*creates
xinming_ SmokeMachine: So, something like Model.^alias("new_table_name").^all.map({ ... }), right? 13:30
SmokeMachine xinming_: yes, something like that... (I don’t remember the exact params it needs) 13:32
xinming_ SmokeMachine: When you gave me the url, I thought you were proposing the new api for Temp table features
will check the source
SmokeMachine: It needs :$base, :$relationship, :$join-type 13:35
SmokeMachine: Doesn't work, will need to pass :$base 13:41
I actually `temp Model.^table = "blabla"` easier to understand. as people know how to point select to another table. 13:43
I actually think* 13:44
SmokeMachine xinming_: I agree... 13:45
xinming_ We need to enable some easy tricks for people to use
the .^alias needs all 3 args to be passed. 13:46
SmokeMachine xinming_: doesn’t that work without the temp?
xinming_ without temp, I got error, Cannot modify an immutable Str(table_name_provided)
SmokeMachine I’ll need to take some time to take a look at this... 13:49
That’s on the queue... the first item on the queue is the Optimization bug... 13:50
xinming_ SmokeMachine: I had the `temp Model.^table = "new_name"` 14:02
I find the issue, will send the patch.
SmokeMachine Great! What was the issue?
xinming_ -multi trait_mod:<is>(Mu:U $model, Str :$table! where .chars > 0 --> Empty) { 14:03
+multi trait_mod:<is>(Mu:U $model, Str :$table! is copy where .chars > 0 --> Empty) {
Y
in Red::Traits 14:04
glad that I can red the source code. :-)
I wish one day, I can understand the whole source of rakudo whole stack, including MoarVM 14:05
SmokeMachine That seems to make sense!!! :) 14:06
xinming_ SmokeMachine: I've submitted the patch for `temp Model.^table = "temp_name"` 14:24
xinming_ SmokeMachine: How do we define multiple column to sort please? 14:29
sort(*.col1) is understandable, If we need 2 columns, col1 DESC, col2 ASC
How do we specify this?
SmokeMachine .sort: { .col1, .col2, .col3 } 14:30
.sort: { .col1, -.col2 } 14:31
stoned75 hi. I'm looking for Bool.value method definition. I am not able to find it...
xinming_ stoned75: Just grep doc, Bool in rakudo seems to be implemented with enum. Not class 14:33
SmokeMachine: thanks.
SmokeMachine m: did True
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
did used at line 1. Did you mean 'die', 'dir', 'dd'?
SmokeMachine m: dd True 14:34
camelia Bool::True
xinming_ m: dd Bool
camelia Bool
stoned75 OK got it. Thanks ! 14:35
SmokeMachine m: dd Bool.keys
camelia ()
SmokeMachine Wrong...
(Too long without writing code... :)) 14:36
m: dd Bool::.keys 14:38
camelia ("False", "True").Seq
stoned75 m: Bool.^find_method("value") 14:41
camelia ( no output )
stoned75 I was thrown off tracks by that :) 14:42
SmokeMachine m: Int.^find_method(“value”).wrap: -> | { say “it’s Int”; nextsame }; True.value 14:52
camelia No such method 'wrap' for invocant of type 'Mu'. Did you mean 'WHAT'?
in block <unit> at <tmp> line 1
tbrowder .tell ugexe the apparent "problem" with zef was my failure to see the msg that one of several deps had failed testing and thus the attempted installation failed. zef is working fine! 15:09
tellable6 tbrowder, I'll pass your message to ugexe
SmokeMachine Does anyone know anything that could be pulling Red’s test image more than 100 times in 6 hours? 16:18
lizmat Google?
SmokeMachine lizmat: downloading a Docker image? 16:19
moritz travis CI or so?
lizmat you'd be surprised :-)
SmokeMachine This is the problem: usercontent.irccloud-cdn.com/file/...690819.JPG 16:20
SmokeMachine I don’t think that’s travis’ fault... usercontent.irccloud-cdn.com/file/...690916.JPG 16:22
El_Che SmokeMachine: the "solution" is looking fron something else than dockerhub :( 16:24
SmokeMachine El_Che: yes, I’m planing on moving the image to GitHub... 16:25
El_Che they killed the platform softly
like the song
SmokeMachine But I really would like to know what’s downloading that so many times... 16:26
El_Che probably a CI somewhere
like moritz said
moritz SmokeMachine: note that pull rate limit could refer to an IP, not just an image 16:39
I'm kinda surprised if your CI doesn't have a caching docker registry proxy by now
El_Che it goes both ways, e.g. like a big institution like a university connecting through the same IP while they have a zillion of departments 16:51
SmokeMachine moritz: do you mean travis or my yaml? 17:18
moritz travis 17:19
SmokeMachine moritz: it seems to pull that every time... :(
JRaspass It's very WIP but I thought this would be a good place to mention a little side project myself and jjatria have been working on - raku.land is an attempt to make a distro directory in pure Raku. It's not as feature full as modules.raku.org yet but it's been fun to use Raku in anger. 17:24
moritz JRaspass: very nice! 17:30
JRaspass Technically the markdown processing is ruby, so mostly raku :-P Plenty on the roadmap though 17:31
you can go a long way with cro on-top of postgres though
El_Che JRaspass++ JJAtria[m]++ 18:41
weekly: raku.land is an attempt to make a distro directory in pure Raku by JJAtria[m] amd JRaspass 18:42
notable6 El_Che, Noted! (weekly)
tbrowder ditto! looks very nice! 19:00
JJAtria[m] Thanks for the encouragement! :D 19:09
We're currently reading only the CPAN dists, to keep things simple
JRaspass git is doable, but yeah fiddly, very interested in future plans for the ecosystem 19:18
SmokeMachine JJAtria[m]: that explains why I haven’t found some of my modules... 19:20
JJAtria[m] An earlier version was processing the dists from the p6c ecosystem, but supporting both git and CPAN ended up being a bit of a time drain when it came to implementing new features, so we decided to focus on only one for now 19:22
SmokeMachine JRaspass++, JJAtria[m]++
Geth doc: 744fbdd1cb | (Stoned Elipot)++ | doc/Language/typesystem.pod6
whitespace fix
19:32
linkable6 Link: docs.raku.org/language/typesystem
stoned75 on the enum type yes, but on one of its enum-pair ? 20:55
m: enum foo <a b>; say (a.pick(True), a.pick(False));
camelia ((a) ())
timotimo pick takes as argument "how many to return" so your True and False are used as numbers 20:56
m: enum foo <a b>; foo::.keys.pick.say for ^5 20:57
camelia b
a
b
a
b
timotimo m: enum foo <a b>; foo::.keys.pick.raku.say for ^5
camelia "b"
"b"
"a"
"a"
"a"
stoned75 here your are picking the enum's keys, not an enum-pair
timotimo what do you mean by enum-pair? 20:59
m: enum foo <a b>; foo::.enums.pick.raku.say for ^5
camelia No such method 'enums' for invocant of type 'Stash'. Did you mean any
of these: 'elems', 'Num'?
in block <unit> at <tmp> line 1
timotimo m: enum foo <a b>; foo.enums.pick.raku.say for ^5
camelia :b(1)
:a(0)
:b(1)
:b(1)
:b(1)
stoned75 I was using True/False in my example, only to illustrate that , in the end, pick (and roll btw) on an enum-pair is only about producing an empty list (for pick(False)) or a singleton list containing the enum-pair key (for pick(True))
with enum foo <a b> 'a' is a enum-pair 21:00
m: enum foo <a b>; say a.pair 21:01
camelia a => 0
timotimo ah, now i get it 21:05
i should probably have read more backscroll
stoned75 no problem, sorry for not being clear 21:06
stoned75 exploring perl6-all-modules, I may find use cases :) 21:07
timotimo do you know about greppable6? :) 21:31
melezhik looks like colabti.org is down , can't read raku irc logs ... 21:33
JRaspass yeah likewise 21:37
stoned75 timotimo: I forgot about greppable6 but I always have an up t odate clone on fast storage, so git log -p | rg is cheap ;-) 21:47
timotimo yes that's very useful indeed 21:49
notagoodidea raku.land is neat but I miss the option to reach the repo of the module? or is it just to show the readme from them? Also, does it only contain modules from the CPAN? 22:17
JRaspass git is planned, and adding a link to the repo will be trivial, good idea
the plan is to have the provides down the side and render the pod from each one, like metacpan 22:18
but atm only .md is supported and only README, Changes is also ingested but just dumped at the bottom of the page atm 22:19
jdv79 is the public irc log working? i cant connect.
notagoodidea I don't know metacpan (and the perl env in general), I will look after to get the frame of reference.
jdv79 anyone know who runs it? 22:20
JRaspass toolchain gang i presume?
added dist repo link to the roadmap :-) 22:23
notagoodidea thx :)
JRaspass oh sorry i thought you asked who ran metacpan, not the irc logs 22:24
notagoodidea JRaspass: What do you use for syntax highlighting on raku.land? 22:26
JRaspass Ah right we have a unmerged VERY WIP PR for rouge github.com/jjatria/rouge/tree/raku-lexer 22:27
it doesn't handle all of raku's grammar yet 22:28
it knows some builtins like say, but not die, and methods aren't highlighted yet, e.g. raku.land/cpan:JJATRIA/HTTP::Tiny 22:29
notagoodidea Ah, because I am on a issue on skylighting (github.com/jgm/skylighting/issues/114) trying to get raku merged in it. 22:30
The contributors that create the Kate style syntax seems to have covered a lot of ground. 22:31
JRaspass ah cool, i find vscode's annoying when working on raku, it will highlight foo("bar") but get confused by foo('bar')
also it doesn't understand a raku shebang :-(
still calls the lang perl6 in the dropdown
notagoodidea The idea is that if raku is merged to skylighting, I get it in any program that use it. neuron for sure, pandoc also I think. 22:32
JRaspass oh that would be cool 22:34
notagoodidea it can output html too but the output may not be the most friendly to integrate from what I see. 22:38
stoned75 commit: releases enum foo <a b c>; say foo::.values; 22:47
committable6 stoned75, gist.github.com/4555d29c5d8d6d9d35...545dcd4c76
stoned75 commit: releases enum foo <a b c>; say foo::.values; 22:48
committable6 stoned75, gist.github.com/77c314e620dac9e99a...5ca9e6ffbb
Geth doc: 718d1f8c0a | (Stoned Elipot)++ (committed by Juan Julián Merelo Guervós) | doc/Language/typesystem.pod6
Link to Enumeration role documentation

  .. to avoid duplicated and slightly out of date method
description
22:57
linkable6 Link: docs.raku.org/language/typesystem
notagoodidea JRaspass: I have a weird issue with raku.land, raku.land/recent?page=3 don't work (other pages until 10 at least are ok) 22:58
JRaspass ooo, /me checks logs, i bet its a NULL description 22:59
notagoodidea Do you prefer that I open an issue on Gitlab?
JRaspass i might just fix it now ;-) its cro templates don't like Any values, they die when trying to escape the value 23:00
and some dists have null description
JRaspass pushing a fix now 23:08
notagoodidea JRaspass: yep, working! 23:11
JRaspass now to fix the bug where raku.land/cpan:LEMBARK/FindBin-libs dies :-P 23:12
notagoodidea Hum, is there a way to indicate a empty value in an hash at declaration? 23:18
JRaspass Nil? 23:19
notagoodidea a => Nil?
JRaspass yeah or :a(Nil) :-P
notagoodidea m: my %a = foo => Nil, bar => "baz"; say %a; 23:20
camelia {bar => baz, foo => (Any)}
gfldex new/changed modules for the year 2020 gist.github.com/8701757c9fb777b9a2...a002a97023 23:21
JRaspass fixed the other 500, both pushed to githun, thanks for pointing them out
*github, lol
notagoodidea mm, I want to convert a seq <as foo foo in bar bar as foo2> to an hash with <as in> as keys. I tried by split but because of the order when convert to Hash, the first pair as => "foo foo" is erased by as => "foo2". 23:51
leont rotor? 23:52
(or maybe I misunderstand your question)
What is the result you're looking for? what would the whole hash be? 23:53
notagoodidea <as foo foo in bar as foo2> => {as => [foo foo foo2], in => [bar]} 23:54
leont gather/then would work, but there may be a more elegant approach
MasterDuke .classify maybe