🦋 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:00 Tirifto left 00:06 mowcat left 00:43 notagoodidea left 00:58 pecastro left 01:24 rypervenche left 01:32 rypervenche joined 02:18 Xliff joined 02:22 guifa2 joined, cpan-raku left, cpan-raku joined, cpan-raku left, cpan-raku joined
guifa2 El_Che: I'm concerned about when users install the module. It's not hitting it when I do `raku -Ilib` for my test files, but it's definitely hitting it when using `zef install .` 02:23
02:27 guifa2 left 02:34 guifa2 joined 02:44 guifa2 left 02:45 guifa2 joined 03:19 guifa2 left, guifa2 joined 03:27 vrurg left 03:30 rindolf joined 03:33 vrurg joined
raku-bridge <frost> m:([*] 1, ([+] 1,2,3)) 04:00
raku-bridge <frost> m:([*] 1, ([+] 1,2,3)).say
evalable6 6
04:33 evalable6 left 04:36 evalable6 joined
jmou m: say '#' ~~ /^\#/ 04:56
camelia 「#」
jmou m: say '#' ~~ /^ \#/
camelia 5===SORRY!5===
Regex not terminated.
at <tmp>:1
------> 3say '#' ~~ /^ \#/7⏏5<EOL>
Unable to parse regex; couldn't find final '/'
at <tmp>:1
------> 3say '#' ~~ /^ \#/7⏏5<EOL>
expecting any of:
infix stopper…
jmou is it weird that the regex with a space doesn't parse? 04:57
04:59 vivelakira joined
vivelakira Hi. I’m a student currently working on my dissertation about Raku. The topic is evaluating Raku(perl6) for student with relevant experience. I finally decided to choose to evaluate whether Raku is a good language when dealing with high concurrency for the angle of the topic. However, my problem is I can’t find any papers about Raku’s 05:00
concurrency except official website. Also, I have no idea about how to evaluate Raku’s concurrency (e.g. what program should I use, which language should be compared with Raku). Could anyone give me some hints about it? That would be very very helpful to me. Thank you.
guifa2 jmou: that does seem weird, I'd be curious to know what's causing the issue on it 05:06
vivelakira: for concurrency, I'd imagine comparing with a language like go might be good. You probably won't find many papers (at least, in the academic sense) written on Raku at the moment, but jnthn (Jonathan Worthington) has a number of talks on the topic at conferences that are available on YouTube and he also puts some of his slides up. He's the main person who has worked with concurrency latey 05:07
bisectable6: say '#' ~~ /^ \#/ 05:08
bisectable6 guifa2, Will bisect the whole range automagically because no endpoints were provided, hang tight
guifa2, Nothing to bisect! 05:09
guifa2, Output on all releases: gist.github.com/0e087d1a8b04ff33b1...4b8b019fff
guifa2 jmou: ^^ whatever it is, it's been that way forever
jmou ok it's not just me! 05:10
is it helpful if i file a bug?
these bots are pretty great 05:11
guifa2 jmou: probably. moritz might have an idea if there's something I'm missing (it's a bit late, so maybe my brain is missing something obvious)
jmou same, relearning regexes is an interesting exercise 05:13
err where do bugs get filed? 05:14
05:14 ToddAndMargo joined
ToddAndMargo Hi All. Anyone on newbie duty? IN the following github.com/rakudo/rakudo/blob/mast...6337:multi method contains(Str:D: Str:D $needle --> Bool:D) {338:nqp::hllbool(nqp::isne_i(nqp::index($!value,$needle,0),-1))339:} 05:14
Where does "$!value" comes from and what is it? 05:15
05:16 Doc_Holliwood joined
guifa2 $!value is an attribute of an object of type Str 05:17
it's a very internal value
It's actually defined in the bootstrap file, at github.com/rakudo/rakudo/blob/5df8....nqp#L3427 05:19
vivelakira guifa2: Thank you very much. It seems that there is very little reseach about raku's concurrency, and unfortunately i'm not farmiliar about go. So I'm thinking if i can change an angle for my dissertation. What angle would you recommend that I can use to evaluate for my dissertation topic(the gradual typing has been chosen by somone else)? 05:20
guifa2 I admit I'm not really sure what CS dissertations look like. My dissertation was on medieval literature lol
jmou guifa2: github.com/rakudo/rakudo/issues/4142 fyi, thanks! 05:23
05:23 brtastic joined
ToddAndMargo And line 19 defines the class. 05:24
Follow on question on line 19: my class BOOTSTRAPATTR { has $!name; has $!type; 05:25
Why do I see a lot of examples with a dot ($.name) and these have "$!"?
vivelakira There is many characteristics of raku such as Laziness, subset, but I'm not sure they can be enough to evaluate for a dissertation :9 05:28
guifa2 ToddAndMargo: $.foo calls an accessor method
by default, when you define a class like 05:29
class Foo { has $.bar }
Raku will behind the scenes make a method that's defined as
method bar { return $!bar }
the $!foo variant accesses the variable directly — but it's only available inside of a class 05:30
ToddAndMargo Thank you! 05:31
guifa2 vivelakira: you might try shooting jnthn an e-mail, but being the holidays no idea if he'll respond quickly 05:34
vivelakira Thank you for your advice :) 05:35
guifa2 sorry I can't be more helpful. But good luck with it. You might also try asking around here when it's afternoon / early evening in Europe, as there are more people online then 05:36
ToddAndMargo Another newbie question. Inside a class' method, exactly what is "self". I can pick it up by context from 06:00
class PrintTest { has Str $.Msg; method PrintMsg() { print "self = <" ~ self.Msg ~ ">\n"; print "self = <" ~ self.Str ~ ">\n"; print "self = <" ~ self ~ ">\n"; } } my $x = PrintTest.new(Msg => "abc"); $x.PrintMsg
as the value fed to the method, but do I have the defination down correct? 06:01
guifa2 self is the current instance of an object 06:03
if I have a class like 06:04
class Person { has $.name }
I'll make new people by doing
my $personA = Person.new( name => "John" ); my $personB = Person.new( name => "Alice" )
inside of a class, sometimes you want to reference not the abstract idea of a person, but a single concrete person 06:05
you might have a method like
method introduce { say "Hi, my name is {self.name}" } 06:06
(this is equivalent to $.name)
06:19 sena_kun joined
guifa2 It's mainly useful when in a method you need to pass a reference to the entire specific object. For instance "say self" or similar 06:22
06:41 aborazmeh joined, aborazmeh left, aborazmeh joined 07:03 vivelakira left 07:15 Doc_Holliwood left 07:20 parabolize left 07:21 Ovidius joined 07:38 frost-lab joined 07:41 patrickb joined, aindilis left 07:45 spycrab0 left, brtastic left 07:46 Grinnz left, spycrab0 joined 07:47 zostay left 07:48 zostay joined 07:49 Grinnz joined 07:53 aborazmeh left 07:56 Altai-man joined 07:59 sena_kun left 08:13 Sgeo left, aborazmeh joined, aborazmeh left, aborazmeh joined 08:17 wamba joined 08:18 aborazmeh left 08:23 brtastic joined 08:24 aborazmeh joined, aborazmeh left, aborazmeh joined 08:25 aborazmeh left 08:27 Doc_Holliwood joined 08:28 orinthe left, orinthe joined 08:29 sjm_uk joined 08:35 orinthe5 joined 08:37 orinthe left, orinthe5 is now known as orinthe 08:51 vike joined 08:58 rindolf left 09:00 rindolf joined 09:09 Doc_Holliwood left 09:20 vike left 09:22 thdrmz left 09:29 orinthe left 09:34 sjm_uk left 09:39 vike joined 09:47 vike left 09:48 wamba left 09:57 domidumont joined 09:58 wamba joined 10:11 Doc_Holliwood joined 10:27 notagoodidea joined
notagoodidea Is there a general database interface driver module? I found DBlish and DBDish inside or specific ones like DB::Sqlite & DB::Pg. DBDI project seems dead for the last 10y. 10:34
10:34 vike joined 10:36 vike left 10:41 sno left 10:43 sjm_uk joined 10:57 vike joined, Doc_Holliwood left
moritz DBIish has drivers for sqlite, pg, mysql and oracle, iirc 10:58
11:13 sno joined
notagoodidea moritz: ok thanks, seems the most general-ish module so. 11:14
11:22 brtastic left 11:23 brtastic joined 11:37 ToddAndMargo left 11:47 pecastro joined 11:57 sena_kun joined 11:59 Altai-man left
frost-lab m: while 0 {say 1}; 12:03
camelia ( no output )
frost-lab m: while 0 {say 1};
camelia ( no output )
frost-lab m: say $_ 12:05
camelia (Any)
frost-lab Is the `(0..3).rand` possible to be 3? 12:11
or 3 just is a limit?
moritz you really want (0..3).pick 12:16
m: say (0..3)pick xx 10
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say (0..3)7⏏5pick xx 10
expecting any of:
infix stopper
statement end
statement mod…
moritz m: say (0..3).pick xx 10
camelia (3 0 2 3 3 2 2 1 1 2)
moritz m: say (0..3).roll(10)
camelia (1 3 2 0 3 2 3 1 0 1)
frost-lab Yeh, but I see the `rand` 's doc is "Returns a pseudo-random value belonging to the range.", in this sense, it is possble to be 3 but it 's hard 12:22
In the implementation level, `rand` returns a Num, 3 is more like the limit which never obtained. 12:27
12:35 sjm_uk left
frost-lab When I first print `while 0 { say 1 }` in the REPL, it's ok. but next whatever I typed, it prompts me "Word 'while' interpreted as a listop; please use 'do while' to introduce the statement control word 12:36
------> $ = while⏏ 0 {say 1};
Unexpected block in infix position (two terms in a row)
------> $ = while 0⏏ {say 1};"
Is this a bug? 12:37
lizmat it's probably a REPL artefact 12:40
aukkras m: $ = do while 0 {say 1}; 12:43
camelia ( no output )
aukkras m: say 1 while 0; 12:44
camelia ( no output )
12:48 frost-lab left 13:05 Ovidius left 13:09 leont joined 13:25 daxim left, daxim joined 13:46 jmchael joined 13:51 Doc_Holliwood joined 14:14 suman joined
suman p6: my @header = "V" ~ (1..5); say @header 14:14
camelia [V1 2 3 4 5]
suman How to get [V1 V2 V3 V4 V5] ?
tadzik p6: my @headers = (1..5).map('V' ~ *) 14:16
camelia ( no output )
tadzik p6: my @headers = (1..5).map('V' ~ *); say @headers
camelia [V1 V2 V3 V4 V5]
suman @tadzik Thanks
tadzik you're welcome )
timotimo m: say "V" X~ (1..5); say (1..5) XR~ "V" 14:17
camelia (V1 V2 V3 V4 V5)
(V1 V2 V3 V4 V5)
leont p6: my @header = "V" «~« (1..5); say @header 14:18
camelia [V1 V2 V3 V4 V5]
timotimo m: my @header = 1..5; @header >>R~=>> "V"
camelia Cannot modify an immutable Str (V)
in block <unit> at <tmp> line 1
timotimo m: my @header = 1..5; @header >>[R~]=>> "V" 14:19
camelia ( no output )
timotimo m: my @header = 1..5; @header >>[R~]=>> "V"; say @header
camelia [V1 V2 V3 V4 V5]
timotimo m: my @headers = do for (1..5) { "V$_" }; say @headers 14:20
camelia [V1 V2 V3 V4 V5]
timotimo m: my @headers = "V1".."V5"; say @headers
camelia [V1 V2 V3 V4 V5]
timotimo is this the winner?
tadzik I'd sya so :D 14:23
14:27 notagoodidea left
suman similar to __str__ method for formatting output in python, what is the equivalent in raku? 14:34
timotimo that's just regular old stringification, isn't it? 14:36
14:37 Xliff left
timotimo you'd want to look at .gist if it's fine to have some information loss (like very long lists getting a "..." at the end, or the structure of nested lists not showing up), .Str for simple cases where you'll still get all the data, and .raku for a representation that tries to look like the code you'd write to create the thing 14:38
if you have need for formatted output, like column widths, justification, number of digits, etc etc, then you'll want to look at the sprintf sub and the fmt method
14:39 thdrmz joined
timotimo m: say (1..20).fmt("(>^.^)> % 3x", " <(^.^<)") 14:39
camelia (>^.^)> 1 <(^.^<)(>^.^)> 2 <(^.^<)(>^.^)> 3 <(^.^<)(>^.^)> 4 <(^.^<)(>^.^)> 5 <(^.^<)(>^.^)> 6 <(^.^<)(>^.^)> 7 <(^.^<)(>^.^)> 8 <(^.^<)(>^.^)> 9 <(^.^<)(>^.^)> a <(^.^<)(>^.^)> b <(^.^<)(>^.^)> c <(^.^<)(>^.^)> d <(^.^<)(>^.…
suman m: say (1..20).fmt("(>^.^)> % 3x\n", " <(^.^<)") 14:41
camelia (>^.^)> 1
<(^.^<)(>^.^)> 2
<(^.^<)(>^.^)> 3
<(^.^<)(>^.^)> 4
<(^.^<)(>^.^)> 5
<(^.^<)(>^.^)> 6
<(^.^<)(>^.^)> 7
<(^.^<)(>^.^)> 8
<(^.^<)(>^.^)> 9
<(^.^<)(>^.^)> a
<(^.^<)(>^.^)> b
<(^.^<)(>^.^)> …
suman m: say (1..20).fmt("(>^.^)> % 3x", " <(^.^<)\n")
camelia (>^.^)> 1 <(^.^<)
(>^.^)> 2 <(^.^<)
(>^.^)> 3 <(^.^<)
(>^.^)> 4 <(^.^<)
(>^.^)> 5 <(^.^<)
(>^.^)> 6 <(^.^<)
(>^.^)> 7 <(^.^<)
(>^.^)> 8 <(^.^<)
(>^.^)> 9 <(^.^<)
(>^.^)> a <(^.^<)
(>^.^)> b <(^.^<)
(>^.^)> …
guifa2 egads my eyes 14:44
14:45 Sgeo joined 14:49 Doc_Holliwould joined, Doc_Holliwood left
suman I have a file with 1000 lines. Is it possible to only read the last line to save time? without slurping contents? 15:09
Currently what I do is slurp("$file").split("\n").tail
guifa2 not anything built in. $file.IO.lines.tail will do it lazily, but that still requires reading the whole file 15:11
you could make your own sub that reads from the final character backwards until it finds a newline, and then read back in the rest of the file 15:12
guifa2 bangs head on keyboard (no CLDR release today :-( found an error in the 3-hour parse process … after it finished running) 15:20
15:24 Doc_Holliwould left 15:28 dotdotdot left 15:30 Doc_Holliwould joined 15:32 dotdotdot joined 15:34 thdrmz left
guifa2 grr, and it relates to Raku's grapheme handling. 99% of the time it's awesome, until you need to handle a delimiter followed a combining character ^_^ 15:43
lizmat yeah, it's meant to take those worries away from you, generally 15:45
fortunately, Raku regexes are code, not strings, so you should be able to handle those cases as well, no ? 15:46
15:46 parabolize joined
guifa2 lizmat: I'm doing @strings = $file.slurp.split($del). What's crazy is I even added in handling for it *within* the individual strings in this section (the only one where I expect to maybe get a combining character hanging isolated), but didn't account for one at the beginning of them 15:48
lizmat yeah, those are gotchas at many levels of implementation of Unicode in Raku :-( 15:49
15:51 patrickb left, rindolf left
guifa2 I think if we beefed up Uni a bit more it might help 15:52
15:53 rindolf joined
guifa2 right now it just feels like a not-quite-array, not-quite-string thing, but if it could be used anywhere Str could and in th esame ways, it might do a lot. But internally that would probably be a nightmare 15:53
Also, your language didn't do anything weird so Dutch works :-)
15:54 rindolf left
guifa2 maandag 28 december 2020 om 10:50:04 Eastern-standaardtijd 15:54
15:54 rindolf joined 15:56 Altai-man joined, a86 joined 15:57 a86 left
lizmat guifa2: that's just because the Dutch massively ignored using the en.wikipedia.org/wiki/IJ_(digraph) 15:58
15:59 sena_kun left
guifa2 Also, on my current computer/build of Rakudo, core's datetime formatting is an order of magnitude faster than mine. Not sure if I slowed down, or maybe JIT is working better than my older desktop 15:59
16:09 thdrmz joined 16:11 xinming_ joined 16:14 xinming left 16:16 _jrjsmrtn joined 16:17 __jrjsmrtn__ left 16:22 eseyman left 16:28 notagoodidea joined 16:37 suman left
Geth doc: e1d25c0e06 | (JJ Merelo)++ | documentable.json
Adds configuration, refs #3753, Raku/Documentable#146
linkable6 DOC#3753 [open]: github.com/Raku/doc/issues/3753 [site][❗Blocker❗] Pencil symbol links to a 404 on Github
17:10 jmerelo joined
notagoodidea m: my $foo = 3; say "$foo" given $foo; 17:11
camelia 3
17:11 schlaftier left, schlaftier joined
lizmat m: my $foo = 3; .say given $foo; 17:12
camelia 3
notagoodidea m: my $foo = 3; .say with $foo; 17:13
camelia 3
Geth doc: 44d2c8bef1 | (JJ Merelo)++ | documentable.json
Changes to edit path, refs #3753, Raku/Documentable#146
linkable6 DOC#3753 [open]: github.com/Raku/doc/issues/3753 [site][❗Blocker❗] Pencil symbol links to a 404 on Github
notagoodidea Is it an "better" way to create sub-command with the command line interface than multi dispatch with litteral strings in the MAIN arguments list? 17:27
Right know I am doing to get: ./foo bar <file> -> MAIN ('bar', Str $file) {*} 17:29
tyil notagoodidea: there's nothing wrong with that way to get subcommands 17:31
also, you can use `IO() $file`, and it'll automatically convert that argument to an IO::Path iirc 17:32
but I'm not 100% sure that works the way I'm telling you rn :P 17:33
notagoodidea Good to know for `IO()`. This way is not problematic for one level of sub-command but get quickly troublesome for multi-level or command like `./foo bar <xx> baz <yy>` when `baz <yy>` is optional. 17:36
tyil maybe someone with more knowledge than me has a better idea, perhaps there's something doable with a `proto` 17:37
lizmat there's also modules.raku.org/dist/Getopt::Long 17:40
notagoodidea 17:42
8 roger check [bkm-id] #mark as read
9 roger export [all|tags|bkim-id] to file.[json|md|html]
17:43 Doc_Holliwould left
notagoodidea sorry wild middle click paste jumped in the chat. 17:43
17:50 sno left
leont Getopt::Long generally does a better job of converting arguments IMNSHO, but doesn't really solve the multi-dispatch problem. 17:51
I've been experimenting with that, but I'm not sure I've found a solution I like yet 17:52
(the main problem being gives terribly confusing errors)
Try typing «zef instal» with a single l to see what I mean 17:53
notagoodidea leont: Sorry got disconnect after the zef examples. I think that I have read the rational of Getopt::Long you wrote some days/weeks ago. 18:12
rationale* 18:13
tony-o tyil: the IO() thing should attempt to coerce 18:14
tyil tony-o: yeah, not sure if that'd work the same on MAIN 18:15
(never tried)
tony-o it does 18:16
tyil nice :>
tony-o at least on current rakudo, there was a bug with it several versions ago
Geth doc: 0e2b03cf44 | (JJ Merelo)++ | documentable.json
Changes to editable link, closes #3753
linkable6 DOC#3753 [closed]: github.com/Raku/doc/issues/3753 [site][❗Blocker❗] Pencil symbol links to a 404 on Github
18:34 redhands joined 18:38 tejr left, xelxebar left, asymptotically left 18:39 asymptotically joined, xelxebar joined 18:43 tejr joined 18:50 lucasb joined 18:55 rir left
lizmat and the last Rakudo Weekly News of 2020 hits the Net: rakudoweekly.blog/2020/12/28/2020-...evolution/ 18:56
18:58 guifa2 left
tony-o .tell patrickb can we remove the config stuff from the password branch and put that in a separate issue? 19:00
tellable6 tony-o, I'll pass your message to patrickb
leont lizmat++ 19:24
19:28 mowcat joined 19:31 domidumont left 19:44 seanrobert joined 19:51 Doc_Holliwood joined 19:52 jmerelo left 19:57 sena_kun joined 19:59 Altai-man left, b2gills left 20:02 b2gills joined 20:05 aindilis joined 20:24 seanrobert left 20:39 patrickb joined 20:41 melezhik joined
melezhik Sparky CI starts supporting SCM triggering - github.com/melezhik/sparky#trigger...cm-changes , I'd appreciate if someone checks it out and give a feedback, thanks 20:41
Geth doc: alanrocker++ created pull request #3754:
Update syntax.pod6
20:48 sena_kun left 21:19 rindolf left 21:37 melezhik left 21:53 wamba left, brtastic left
notagoodidea Is there a advantage to use >>->> rather than [Z-] to take the delta of a list/array? Or it is just another way to do it? 22:20
m: my @foo = 10, 20, 50, 100; @foo[1..*] >>->> @foo; 22:21
camelia Potential difficulties:
Useless use of >>->> in sink context
at <tmp>:1
------> 3my @foo = 10, 20, 50, 100; @foo[1..*] 7⏏5>>->> @foo;
notagoodidea m: my @foo = 10, 20, 50, 100; say @foo[1..*] >>->> @foo;
camelia (10 30 50)
notagoodidea m: my @foo = 10, 20, 50, 100; say @foo[1..*] [Z-] @foo;
camelia (10 30 50)
22:23 aluaces left 22:25 cpan-raku left 22:26 cpan-raku joined, cpan-raku left, cpan-raku joined 22:32 patrickb left 22:55 melezhik joined 22:57 musasji_the1 joined
melezhik vrurg your build now got run - rakudist.raku.org/sparky/report/RakuPlay-1/8877 , first time it did not, b/c it was a bug in RakuPlay which is fixed now 22:58
vrurg melezhik++ 23:03
23:08 melezhik left 23:33 coldpress left 23:43 chloekek joined
chloekek m: '災'.uniprop('kSimplifiedVariant') 23:44
camelia ( no output )
chloekek m: say '災'.uniprop('kSimplifiedVariant')
camelia 0
chloekek 不好
m: say '災'.uniprop('SimplifiedVariant') 23:45
camelia 0
chloekek m: say '災' coll '灾' 23:47
camelia Less
23:53 musasji_the1 left