🦋 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.
00:00 zups left, gugod left, peder left, mark22k left, spacekookie left, rypervenche left, charsbar left, cm left, eseyman left, kybr left, broquaint left, renormalist left, amenonsen left, kaol left, gabiruh left, kaol joined, renormalist joined, gugod joined, Manifest0 left, reportable6 left, kybr joined, rypervenche joined, peder joined, rypervenche left, rypervenche joined, charsbar joined, zups joined 00:01 reportable6 joined 00:02 gabiruh joined, cm joined, amenonsen joined, mark22k joined 00:03 Geth left, Geth joined, spacekookie joined 00:05 broquaint joined, eseyman joined 00:19 sivoais left, sivoais joined 00:47 deoac joined 01:04 jrjsmrtn left, jrjsmrtn joined 01:53 cm left 02:01 deoac left 02:09 cm joined 02:17 cm left 02:18 cm joined 03:27 quotable6 left, benchable6 left, bloatable6 left, shareable6 left, evalable6 left, bisectable6 left, coverable6 left, statisfiable6 left, linkable6 left, unicodable6 left, committable6 left, notable6 left, reportable6 left, nativecallable6 left, sourceable6 left, tellable6 left, greppable6 left, releasable6 left, squashable6 left 03:28 sourceable6 joined, tellable6 joined, reportable6 joined, quotable6 joined, benchable6 joined, shareable6 joined, unicodable6 joined 03:29 committable6 joined, coverable6 joined, linkable6 joined, greppable6 joined, bisectable6 joined, releasable6 joined, statisfiable6 joined 03:30 squashable6 joined, evalable6 joined, bloatable6 joined, notable6 joined, nativecallable6 joined 04:15 Voldenet left, Voldenet joined 04:32 lucs left, lucs joined 04:36 elcaro left, elcaro joined 05:21 kjp joined 06:00 reportable6 left, reportable6 joined 06:48 abraxxa joined 07:11 Manifest0 joined 07:16 Scotteh left, Scotteh joined 07:56 jpn joined 08:05 jpn left 08:08 ab5tract left 08:10 ab5tract joined, ab5tract left, ab5tract joined 08:21 teatwo left, teatwo joined 08:23 jpn joined, teatwo left, teatwo joined 08:36 Sgeo left 08:37 Sgeo joined 08:58 teatwo left, teatwo joined 09:00 Sgeo left 09:23 ab5tract left 09:43 ab5tract joined 10:17 abraxxa left 10:41 nine left, m_athias left, camelia left 10:59 m_athias joined 11:04 nine joined 11:16 ab5tract left, ab5tract joined 11:29 camelia joined 11:52 gordonfish left 11:53 gordonfish joined 12:00 reportable6 left 12:02 abraxxa-home joined 12:03 reportable6 joined 12:04 abraxxa-home left 12:39 cm_ joined, cm left, cm_ is now known as cm 13:58 nativecallable6 left, coverable6 left, statisfiable6 left, reportable6 left, unicodable6 left, squashable6 left, committable6 left, tellable6 left, bloatable6 left, greppable6 left, releasable6 left, sourceable6 left, evalable6 left, notable6 left, bisectable6 left, shareable6 left, quotable6 left, linkable6 left, benchable6 left 13:59 bloatable6 joined, bisectable6 joined, coverable6 joined, notable6 joined, linkable6 joined, reportable6 joined, shareable6 joined, releasable6 joined 14:00 benchable6 joined, committable6 joined, sourceable6 joined, squashable6 joined, quotable6 joined 14:01 nativecallable6 joined, statisfiable6 joined, unicodable6 joined, greppable6 joined, evalable6 joined, tellable6 joined 14:20 pierrot_ left 14:21 pierrot joined 14:33 synthmeat left 14:34 synthmeat joined 15:00 Sgeo joined
nemokosch raku.land/github:masak/Alma having * as version is not nice 15:24
antononcube 🙂 The corresponding GitHub repository has 217 open issues, (and 223 closed ones.) 15:37
16:00 linkable6 left, evalable6 left, evalable6 joined 16:02 linkable6 joined
nemokosch Including several by Mäsak himself since he stopped doing anything substantial 16:11
lizmat masak is behind the great firewall nowadays *and* busy with other stuff 16:18
nemokosch regardless, a *-versioned distribution popping up in raku.land is probably an anomaly 16:42
sitting on top of "recent dists" simply because some textual modification
lizmat I've created a PR with suggestion of publishing on zef 16:48
we can also of course remove Alma from the ecosystem 16:49
17:02 evalable6 left, linkable6 left 17:03 linkable6 joined 17:05 evalable6 joined 17:14 discord-raku-bot left, discord-raku-bot joined
leont repeats his rant about versions versus version ranges 17:18
librasteve looking again at Alma - seems like there are some familiar things from the recent AST work … and yet I do not recall seeing any info on macros in the recent AST material … did I miss anything?
17:20 timo left 17:21 timo joined
antononcube @leont Please summarize your recent publishing of "SQL::Abstract" in Zef ecosystem. 🙂 17:23
leont antoncube: in what way do you mean that? 17:24
antononcube @leont Agh, something you already did here: github.com/Leont/sql-abstract/blob/main/Changes 17:25
I should start keeping "Changes" files in my packages... 17:26
17:29 coleman left
lizmat at the Raku Core Summit we agreed to look at what macros are going to do *after* the rest of RakuAST has materialized 17:30
17:31 coleman joined 18:00 reportable6 left 18:02 reportable6 joined, nebuchad` left 18:03 nebuchad` joined
librasteve lizmat: makes sense... I look forward to being able to instantiate objects via macros so that they can be precomped 18:04
coleman m: sub foo(@*cmd) { say @*cmd }; foo(<123>); 18:10
camelia Type check failed in binding to parameter '@*cmd'; expected Positional but got IntStr (IntStr.new(123, "123"))
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
coleman m: sub foo(@*cmd) { say @*cmd }; foo(<123 456>); 18:11
camelia (123 456)
coleman I was expecting <123> to work
[Coke] m: sub foo(@*cmd) { say @*cmd }; foo(|<123>)
camelia Type check failed in binding to parameter '@*cmd'; expected Positional but got IntStr (IntStr.new(123, "123"))
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
coleman m: sub foo(@*cmd) { say @*cmd }; foo(('123'));
camelia ===SORRY!=== Error while compiling <tmp>
Calling foo(Str) will never work with declared signature (@*cmd)
at <tmp>:1
------> sub foo(@*cmd) { say @*cmd }; ⏏foo(('123'));
[Coke] m: sub foo(@*cmd) { say @*cmd }; foo(<123>,) 18:12
camelia Type check failed in binding to parameter '@*cmd'; expected Positional but got IntStr (IntStr.new(123, "123"))
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
nemokosch <123> is an Allomorph, not a list
coleman m: sub foo(@*cmd) { say @*cmd }; foo(@('123'));
nemokosch that's not going to work
camelia (123)
[Coke] Note the @* parameter, I am assuming that's why he thought it might.
(instead of a simple @)
coleman m: sub foo(@*cmd) { say @*cmd }; my @x = <123>; foo(@x);
camelia [123] 18:13
nemokosch that gets consumed by the bridge
as markdown
[Coke] m: <123>.WHAT.say 18:14
camelia (IntStr)
nemokosch oh, it's *@, not @*
[Coke] m: <123 2345>.WHAT.say
camelia (List)
nemokosch @* is dynamic
18:15 jpn left
(and you should really be using **@ because *@ auto-flattens the received arguments) 18:15
Coke: good that you are here, I have a wholesome issue for zef-deps 18:16
zef broke one of the tests
coleman I am indeed mixing up *@ and @*; But the type of <123> was surprising
nemokosch I would say it kinda makes sense, given the round parens 18:17
but then
m: <foo >.WHAT.say
why doesn't it run
Raku eval (Str)
nemokosch so yeah, not even the whitespace helps here 18:18
[Coke] m: qqw{123}.WHAT.say' 18:19
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> qqw{123}.WHAT.say⏏'
expecting any of:
infix stopper
statement end
statement modifier
[Coke] m: qqw{123}.WHAT.say
camelia (Str)
[Coke] m: qqw{123 234}.WHAT.say
camelia (List)
[Coke] I believe it's just nice syntax for a q*w op. 18:20
coleman it seems like only @( ) guarantees a "list literal"
nemokosch [] kinda does, too, but that's also just a coercion call
so [[whatever]] and [whatever] are the same
gfldex m: sub foo(@*cmd) { say @*cmd }; foo(@<123>) 18:21
camelia (Nil)
nemokosch @( ) calls .list and [ ] calls .Array iirc
gfldex m: sub foo(@*cmd) { say @*cmd }; foo(@(<123>))
camelia (123)
gfldex Anon got me again!
nemokosch sigils without the paren should be forbidden, change my mind 🐸 18:22
I don't think it would be even hard to implement that "ban" 18:23
just check why $[0, 1] works and remove the matching grammar rule 18:24
gfldex <123> is a plural form for a singular thing. Instead of whining Raku will invode the single argument rule and convert to a singular form. 18:25
m: %h = :1a, :2b; say %h<a>.WHAT; 18:26
camelia ===SORRY!=== Error while compiling <tmp>
Variable '%h' is not declared. Perhaps you forgot a 'sub' if this was
intended to be part of a signature?
at <tmp>:1
------> <BOL>⏏%h = :1a, :2b; say %h<a>.WHAT;
gfldex m: my %h = :1a, :2b; say %h<a>.WHAT;
camelia (Int)
gfldex %h<a> does not return a plural form. I my eyes that makes sense.
m: sub foo(@*cmd) { say @*cmd }; foo(123,); 18:27
camelia ===SORRY!=== Error while compiling <tmp>
Calling foo(Int) will never work with declared signature (@*cmd)
at <tmp>:1
------> sub foo(@*cmd) { say @*cmd }; ⏏foo(123,);
gfldex m: sub foo(@*cmd) { say @*cmd }; foo (123,);
camelia (123)
gfldex That's the one I don't like much.
[Coke] gfldex: do you mean to be using @* and not *@ ? 18:28
we switched halfway through. :)
gfldex Well, the need of *@ is kinda a consequence of the single argument rule for literals. And to make feed operators work. 18:29
nemokosch opened the issue for zef-deps 18:30
[Coke] nemokosch: thanks for the bug report, will drop a new version this weekend.
nemokosch thank you 18:31
librasteve dons hard hat 18:38
m: say (123) ~~ Iterable
Raku eval False 18:39
librasteve m: say (123, 456) ~~ Iterable
Raku eval True
librasteve m: say <123> ~~ Iterable
Raku eval False
librasteve m: say <123 456> ~~ Iterable
Raku eval True
librasteve BUT, the angle brackets are also shorthand for Allomorph literal 18:40
m: say <123>.WHAT
Raku eval (IntStr)
gfldex I strongly advice not to use `~~ Iterable`. 18:41
librasteve AND, also shorthand for qqw
m: dd <a b c>
Raku eval ("a", "b", "c") 18:42
librasteve gfldex: why's that then?
gfldex There is lots of stuff that got a .iterable but does not do Iterable.
librasteve so what's the best way to test for plurality? 18:43
nemokosch or not even .iterable but .list
looking at you, Blobs and Bufs 18:44
gfldex In doubt, don't test for plurality and call .map or .grep . And no, I don't like that answer either. 18:45
Iterators where added quite late to the language and clash with some of the design.
`for` used to forward to .map and still does when you `do for`. 18:46
librasteve m: 1.map(*.say) 18:47
Raku eval 1
gfldex Before lizmat added iterators, all you had to do for a custom type was to overload .map and .grep and iteration was covered. 18:48
Any got .map .
librasteve so I call map on a single item and get "True" ... how do I use that to test for plurality?
gfldex Sadly, gather/take is quite slow and that makes iterators useful. 18:49
librasteve m: my Buf $b .= new(^10); say $b ~~ Iterable; 18:50
Raku eval False
gfldex You can't really test for plurality. Nor should you need to care. That's what the one argument rule and slurpy arguments are for.
m: Buf.^mro.say;
camelia No such method 'mro' for invocant of type
in block <unit> at <tmp> line 1
librasteve so my Buf has a list method but is not iterable ... well that's fine by me
gfldex m: Buf[8].^mro.say;
camelia No such method 'mro' for invocant of type
in block <unit> at <tmp> line 1
librasteve gfldex: I like that usually I don't have to care - but sometimes it may be that I want to care 18:51
anyway - I'll put on my back burner for now 18:52
gfldex I have the same urge. Raku is not the answer. At least not v6.d and v6.e .
18:53 coleman left
librasteve that's the f burner then 18:53
18:55 coleman joined 18:59 jpn joined 19:05 jpn left
nemokosch you can't not care when literally most of the essential data constructions may give you a sole instance or a list depending on the data they receive 19:20
librasteve m: sub plural(\x) { my $c++ for |x; ($c-1).so } say plural <123>; 19:56
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Strange text after block (missing semicolon or comma?) at /home/glot/main.raku:1 ------> plural(\x) { my $c++ for |x; ($c-1).so }⏏ say plural <123>; expecting any of: infix infix stopper statement end statement modifier statement modifier loop
librasteve m: sub plural(\x) { my $c++ for |x; ($c-1).so }; say plural <123>; 19:57
Raku eval False
gfldex @librasteve .elems is not a bad idea until you hit 1..* :-> 19:59
But then, one could argue an infinite list to be just _one_ things. 20:00
Plural is equally hard then singular, it seems.
librasteve well, maybe need ot guard things like infinite ranges... 20:02
gfldex You can't really do that, because of iterators. 20:03
librasteve sub plural(\x) { return True with x[1]; my $c++ for |x; ($c-1).so } 20:05
20:05 linkable6 left, evalable6 left
gfldex In Raku custom types can be infinite and lazy but wont tell you unless you try to iterate 'til the end. 20:05
20:05 linkable6 joined
gfldex And they don't have to implement AT-POS, either. 20:06
20:06 evalable6 joined
nemokosch .elems is usually not a good idea unless you really want to get an exact number 20:09
m: (1..*).elems.say 20:10
Raku eval Exit code: 1 Cannot .elems a lazy list onto a Range in block <unit> at main.raku line 1
nemokosch bang
(the bogus error message has been fixed since)
librasteve thought about .pull-one but then that is not idempotent 20:11
so basically raku is lisp under the hood 20:13
20:14 teatime joined, teatwo left
gfldex In Lisp, everything is a list. It does not have singular. Raku clearly does. However, it it not your concern to force conversion between singular and plural. You just tell the compiler what you want to do. And then the "strangly consistent"-thing happens. 20:15
nemokosch this is not the "strangely consistent" part, this is the "do what I mean" part 20:18
20:22 teatime left, teatime joined 20:23 teatwo joined 20:24 jpn joined 20:26 tea3po joined 20:27 teatime left 20:29 jpn left, teatwo left, tea3po left 20:30 tea3po joined 20:55 jpn joined
lizmat gfldex: for foo { } is basically foo.iterator.sink-all under the hood 20:59
foo.map is basically foo.iterator.push-all(@result) 21:04
it *is* the same mechanism under the hood, just different methods being called on the iterator
21:07 NemokoschKiwi joined 21:18 tea3po left 21:19 tea3po joined 21:26 NemokoschKiwi left 21:38 deriamis joined 21:41 melezhik joined
melezhik o/ 21:41
Announcement for SparrowCI users - dev.to/melezhik/sparrowci-has-move...ences-110o
weekly: dev.to/melezhik/sparrowci-has-move...ences-110o
notable6 melezhik, Noted! (weekly)
21:46 jpn left 21:50 melezhik left 22:50 evalable6 left, linkable6 left, evalable6 joined, defaultxr left, modula joined 22:52 linkable6 joined
ugexe I’m pretty sure there are precompilation releases for arm 23:19