🦋 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:02 sena_kun joined 00:04 Altai-man_ left 00:05 hungrydonkey left 00:10 hungrydonkey joined 00:12 finanalyst joined 00:31 hungrydonkey left, hungrydonkey joined 00:45 hungryd20 joined 00:47 hungrydonkey left 00:49 finanalyst left 00:50 hungryd20 left 00:51 hungrydonkey joined 01:06 oddp left 01:24 nightfrog joined 01:57 molaf left 02:01 ensamvarg3 joined, Altai-man_ joined 02:04 sena_kun left 02:05 Manifest0 left 02:06 Manifest0 joined 02:10 molaf joined 02:21 Cabanossi left 02:22 reach_satori left, reach_satori joined 02:25 adu joined
adu how do you express empty? 02:25
wasn't something like <!> 02:26
Xliff asu: As in set empty? 02:29
02:31 Cabanossi joined
Xliff m: my $a = ø; $a.gist.say 02:32
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
ø used at line 1
Xliff m: 'ø'.uniname.say
Xliff m: 'ø'.ord.say
camelia 248
Xliff m: my $a = ∅; $a.gist.say 02:33
camelia Set()
Xliff adu ^^
sourceable: ∅ 02:35
sourceable6 Xliff, No idea, boss. Can you give me a Code object?
Xliff sourceable: my $a = ∅
sourceable6 Xliff, github.com/rakudo/rakudo/blob/c7c1...ors.pm6#L9
adu Xliff, no empty grammar production 02:42
02:45 xinming_ left 02:46 xinming_ joined 03:05 bdju left, bdju joined 03:11 tejr joined 03:13 Guest311 left
adu How you you represent the empty grammar production? 03:18
SmokeMachine m: say Empty 03:21
camelia ()
adu m: say "".match(token { Empty }) 03:25
camelia Nil
adu m: say "".match(token { <!> })
camelia Nil
adu m: say "".match(token { "something" }) 03:26
camelia Nil
adu m: say "".match(token { "" })
camelia 「」
adu There we go
timotimo m: say "".match(rx/<?>/) 03:29
camelia 「」
timotimo m: say "oh".match(rx/<?>/)
camelia 「」
03:29 Cabanossi left 03:40 Cabanossi joined 03:43 wamba joined 04:02 sena_kun joined 04:04 Altai-man_ left 04:11 OpenZen left 04:16 softmoth joined 04:18 Xliff left 04:20 OpenZen joined 05:06 molaf left 05:08 wamba left 05:29 OpenZen left 05:43 wamba joined 06:01 wamba left, Altai-man_ joined 06:04 sena_kun left 06:05 stoned75 left 06:07 stoned75 joined 06:08 molaf joined 06:21 adu left 06:26 tejr left 06:27 hungrydonkey left 06:30 tejr joined 06:34 hungrydonkey joined 06:38 softmoth left 07:09 brtastic joined 07:20 nightfrog left, nightfrog joined 07:24 Black_Ribbon left 07:33 brtastic left
AlexDaniel u: İ 07:43
unicodable6 AlexDaniel, U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE [Lu] (İ)
AlexDaniel this is so weird :D
07:51 dolmen joined 08:03 sena_kun joined 08:04 Altai-man_ left 08:05 dolmen left 08:08 dolmen joined 08:19 dolmen left 08:26 aborazmeh joined, aborazmeh left, aborazmeh joined 08:29 molaf left
moritz it's used in Turkey for uc('i') 08:43
08:51 pecastro joined 08:53 ChrisRakuIrc joined 09:02 bocaneri left 09:04 bocaneri joined
El_Che I wonder if instead of declaring the name as a dependency, an uri with version (tag) could be declared. It solved the centralization problem 09:10
the only mandatory bit is forcing authors to use tags for releases, but that's something sane people do already 09:12
09:14 oddp joined 09:17 ChrisRakuIrc left, ChrisRakuIrc joined 09:26 ChrisRakuIrc left, ChrisRakuIrc joined 09:27 ChrisRakuIrc left 09:44 chrisMuc joined 09:45 chrisMuc left 09:49 hungrydonkey left, hungrydonkey joined, aborazmeh left 09:51 aborazmeh joined, aborazmeh left, aborazmeh joined 09:55 chrisMuc joined 09:58 chrisMuc left 10:01 Altai-man_ joined 10:04 sena_kun left 10:45 aborazmeh left 10:48 rindolf joined 10:50 holyghost joined 10:56 kensanata joined 11:21 hungrydonkey left 11:28 holyghost left 12:02 sena_kun joined 12:04 Altai-man_ left 13:05 linkable6 joined 13:07 evalable6 joined 13:20 nightfro` joined, nightfrog left, nightfro` is now known as nightfrog 13:23 lucasb joined 13:32 orinthe3 joined 13:34 orinthe left, orinthe3 is now known as orinthe 13:50 Cabanossi left 13:52 Cabanossi joined 14:01 rir joined 14:02 Altai-man_ joined 14:05 sena_kun left 14:10 rbt left 14:11 rbt joined 14:20 dolmen joined 14:37 fling left
rbt t 14:39
14:49 rbt left
gfldex lolibloggedalittle: gfldex.wordpress.com/2020/07/04/pi...made-easy/ 14:55
14:58 softmoth joined
AlexDaniel gfldex: another meaning is “it's not provided by core yet” :P 15:15
but yes, I actually need something like this 15:16
15:17 rbt joined 15:20 softmoth left
moritz m: say <a b c>[0, 1] 15:21
camelia (a b)
moritz m: say <a b c>[0, 1]:kv.perl
camelia (0, "a", 1, "b")
moritz m: say <a b c>[0, 1]:p.perl
camelia (0 => "a", 1 => "b")
15:23 cpan-raku left
moritz I'm trying to get the index of the shortest element of an array 15:23
(and ingoring undefined values) 15:24
15:24 cpan-raku joined, cpan-raku left, cpan-raku joined
moritz is there anything more compact/readable than .pairs.grep(*.value.defined).min(*.value.chars).key; ? 15:24
15:25 dolmen left 15:31 fling joined
gfldex AlexDaniel: The custom IO::Handle part or the whole thing? 15:34
Altai-man_ m: <a aa aaa a>.pairs.sort(*.value.chars).tail.key.say 15:36
camelia 2
Altai-man_ moritz, ^ maybe this one is a bit more easy to read. But not really very concise.
AlexDaniel Altai-man_: that's potentially slower 15:37
moritz m: say ('aaa', 'aa', 'a', Any).pairs.sort(*.value.chars).tail.key.say
camelia No such method 'chars' for invocant of type 'Any'
in block <unit> at <tmp> line 1
Altai-man_ Ah, and there are also undefined ones...
Ok, never mind.
AlexDaniel moritz: if you're not using sort, then you're potentially not even creating a copy of your initial array 15:40
it'll be seqs and iterators all the way through, if rakudo does things right
m: my @a = (‘foo’, ‘xxx’, ‘b’, Nil, ‘za’, ‘nnn’); say @a.pairs.min({.value.?chars // ∞}).key 15:43
camelia 2
AlexDaniel moritz: what about this? 15:44
moritz AlexDaniel: I like the sneaky way it avoids the extra grep, thanks :D
AlexDaniel m: my @a = (‘foo’, ‘xxx’, ‘b’, Nil, ‘za’, ‘nnn’); say @a[]:p.min({.value.?chars // ∞}).key 15:48
camelia 2
AlexDaniel a little bit of code golf :)
moritz I'm working on a small program that generates strings from regexes 15:50
in particular, shortest possible strings
I'm sure it's been done before (even in raku), this is just a way to solidify my understanding of regex semantics 15:51
lazy lists are gold for that :D 15:58
codesections question: are there limits (or ways to set limits) to the amount of resources a `hyper` operation takes up? I ask, because I was trying to build a shellscript like program to query zef for package info last night, and kept running into problems 16:00
I ended up using something along the lines of:
moritz codesections: .hyper(jobs => 3) iirc
codesections for $long-input.lines -> bution { f', 'info' $distribution }
moritz: thanks! That's the syntax I should have been using 16:01
moritz docs.raku.org/routine/hyper 16:02
it's degree, not jobs
16:02 sena_kun joined
codesections `hyper for $long-input.lines -> bution { f', 'info' $distribution }` was impressively capable of bringing even a pretty beefy dev machine to its knees! 16:03
16:04 Altai-man_ left, dolmen joined
moritz for $.long-input.lines.hyper(:2degree) -> $line { ... } maybe? 16:04
codesections Oh, there's my problem: I was reading the wrong docs page. I was on docs.raku.org/language/operators#i..._operators
(which doesn't mention degree) 16:05
Thanks for the pointer to the right page!
moritz enjoy, and good luck :D 16:09
16:18 vike left
samebchase- gfldex: wow. great post! 💯 16:25
gfldex :) 16:29
codesections > great post! 16:34
One question, though: is the complexity of this driven by wanting/needing to keep the async nature of shell pipes? 16:35
If you were willing to wait for the first task to finish, you could do something simple with `==>`, right?
16:39 charsbar joined
moritz my @a = ['a', 'b'], ['X'], ['1', '2']; say cross(@a).perl; say cross(|@a).perl; 16:53
evalable6 (($["a", "b"], $["X"], $["1", "2"]),).Seq
(($["a", "b"], $["X"], $["1", "2"]),).Seq
moritz none of those seem to work
16:53 JJMerelo joined
moritz what do I have to do to get the cross product of an array of arrays? 16:54
my @a = ['a', 'b'], ['X'], ['1', '2']; say cross(@a.map(*.list)).perl 16:55
evalable6 (("a", "X", "1"), ("a", "X", "2"), ("b", "X", "1"), ("b", "X", "2")).Seq
moritz aaaaargh, I HATE list handling
why do I need the .list here?
tobs m: my @a = ['a', 'b'], ['X'], ['1', '2']; say [X] @a 16:56
camelia ((a X 1) (a X 2) (b X 1) (b X 2))
tobs does this do what you needed? As for the *.list, I don't know :/ 16:57
moritz tobs: that'd help, but in the end I actually want to do cross(..., :with)
JJMerelo The .Seq will be introduced by the map, right? And then propagated to cross 16:59
tobs aha
m: say cross(['a', 'b'], ['X'], ['1', '2'])
camelia ((a X 1) (a X 2) (b X 1) (b X 2))
tobs so it seems to be signature of cross's doing
jnthn m: my @a = ['a', 'b'], ['X'], ['1', '2']; say [X] @a
camelia ((a X 1) (a X 2) (b X 1) (b X 2))
moritz tobs: if that works, I don't understand why cross(|@) doesn't work
cross(|@a) 17:00
JJMerelo: I don't see how the fact that map returns a Seq affects how &cross treats the individual items
JJMerelo moritz right... Well, if cross returns a Seq, I can't really see how you would make it return something else. Why is Seq a problem? 17:02
moritz JJMerelo: that's not my problem at all 17:03
my @a = ['a', 'b'], ['X'], ['1', '2']; say cross(@a)
evalable6 (([a b] [X] [1 2]))
moritz my problem is that in this example, cross treats each inner list as a single item
my @a = ['a', 'b'], ['X'], ['1', '2']; say cross(|@a)
evalable6 (([a b] [X] [1 2]))
moritz and here as well
but in
say cross(['a', 'b'], ['X'], ['1', '2']) 17:04
evalable6 ((a X 1) (a X 2) (b X 1) (b X 2))
moritz it doesn't
and I don't understand that, because my mental of anything(|@a) is that it behaves the same as anything(@a[0], @a[1], ...)
my @a = ['a', 'b'], ['X'], ['1', '2']; say cross(@a[0], @a[1], @a[2]) 17:05
evalable6 (([a b] [X] [1 2]))
17:05 vike joined
moritz so putting the inner arrays into the outer array magically itemizes them 17:06
moritz so >.< close to switching to python
tobs IIRC everything in an array is by default itemized
or well, I don't know. That's a very dark corner of Raku for me. 17:07
moritz I know that array elems need to be containers to allow modifications, but I thought we were past the "a container itemizes" stage 17:08
maybe not
I hate all this list flattening and unflattening magic so much 17:09
JJMerelo It can get complicated and messy, yes...
moritz you know, in python `for i in x()` just throws an exception if x() doesn't return anything iterable
and a, b is always a two-element tuple, no matter the contents of a and b
and then it has an explicit concatenation operator 17:10
it sometimes requires a tiny bit of manual effort, but all the edge cases are perfectly logical and pretty easy to understand
in python, lazy generators and lists are distinct; again not always as comfortable as lazy lists, but performant and easy to understand 17:13
AlexDaniel moritz: is it the case of docs.raku.org/language/traps#Using...t_of_lists ? 17:23
I'm not really following 17:24
moritz: well, yes, Raku is really hard. Nothing is ever straightforward or easy to understand 17:26
there used to be a saying about “baby talk” or something like that, but one thing that people don't mention out loud is that nobody is ever able to learn any feature fully 17:28
17:28 OpenZen joined
AlexDaniel so Raku is fun when you start using it, but the further you go the more frustrated you get 17:29
all the quirks and edge cases bring so much mental load that it's almost unbearable 17:30
“A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away.” 17:32
there's a lot of things to take away from Raku, so you can probably guess what I think about the design :) 17:33
[Coke] tries an older version of rakudo to see if cro works on that. :| 17:34
(zef install cro on this box is soooooo slow. wtf.) 17:40
is there a way to get verbose test output with zef? 'zef test .' is just showing that tests failed. 17:50
timotimo does --verbose or --debug help? zef has many flags in general 17:52
17:53 Tirifto joined
[Coke] verbose did it, thanks 17:53
I tried test --help and it didn't show --verbose (probably a global option not one for the subcommand) 17:54
timotimo ah, possible 17:55
18:02 Altai-man_ joined 18:05 sena_kun left 18:15 maggotbrain joined 18:19 wamba joined 18:28 ensamvarg3 left 18:39 dolmen left
moritz gist.github.com/moritz/af5f3cfcd49...045c1060b9 my basic regex inverter 18:50
supports literals, char classes, alternatives(branches) and quantifiers 18:51
18:53 rbt left
Geth ecosystem: 8b9cf5b873 | thundergnat++ (committed using GitHub Web editor) | META.list
Add Terminal-Boxer

Automatically generate boxed tables, primarily for use in a terminal.
See: github.com/thundergnat/Terminal-Boxer
18:54 rbt joined
[ptc] moritz: is that what was causing you headaches earlier this evening? 18:55
moritz [ptc]: I'd say Raku's list semantics caused the headaches, and I encountered them while implementing them :D 18:56
[ptc] :-D
19:03 softmoth joined
moritz gist updated; now supports conjunctions 19:11
19:14 holyghost joined
holyghost I've just passed my 1st year bachelor of arts (painting) ! 19:16
moritz I wonder if I should add a parser for the regexes :D
holyghost: congrats!
holyghost while working for perl mongers :-) 19:17
codesections (I don't know you but…) congrats! 19:18
19:20 stoned75 left 19:22 stoned75 joined 19:26 telex left 19:27 telex joined 19:41 wamba left 19:57 dolmen joined 20:02 sena_kun joined 20:04 Altai-man_ left 20:34 dolmen left
moritz gist.github.com/moritz/af5f3cfcd49...045c1060b9 updated with a basic regex parser 20:34
it only supports word characters for literals and char class contents, otherwise it supports quantifiers, conjunctions and discjunctions, groups 20:36
20:36 dolmen joined
moritz haven't tried really hard to get the precedence of the parser right, you can always use [] to correct precedence 20:37
[ptc] moritz: are you working on an update to your regex book? 20:50
moritz: just saw your tweet. That answered my question :-) 20:51
moritz nope. And I think it would be too much of a distraction from how regexes work, even if it's somewhat illustrative 20:53
it's a bit sad; the regex book is the one I'm most proud of, but it's the one with the fewest sales 20:54
lizmat but I bet it's a book that is more appreciated by the fewer people that *do* have it 20:55
[ptc] yup, definitely. I definitely enjoyed it while reviewing it :-) 20:57
moritz the feedback has been very positive 20:58
21:00 softmoth left 21:09 aborazmeh joined, aborazmeh left, aborazmeh joined 21:46 Xliff joined 21:47 aborazmeh left 21:52 softmoth joined 21:55 rindolf left 21:58 Maylay joined 22:01 Altai-man_ joined 22:04 sena_kun left 22:12 dolmen left 22:13 dolmen joined 22:16 Benett left 22:22 kensanata left, flossy joined 22:25 Benett joined 22:39 stux|RC-only left 22:44 libertas joined 23:00 dolmen left
cpan-raku New module released to CPAN! LibXML (0.5.4) by 03WARRINGD 23:02
23:12 Benett left 23:18 Benett joined 23:21 Tirifto left 23:23 pecastro left 23:26 vrurg left 23:27 vrurg joined 23:48 flossy left, flossy_ joined