🦋 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.
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
raku-bridge <frost> m:([*] 1, ([+] 1,2,3)) 04:00
evalable6
raku-bridge <frost> m:([*] 1, ([+] 1,2,3)).say
evalable6 6
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
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
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
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
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)
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
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
moritz DBIish has drivers for sqlite, pg, mysql and oracle, iirc 10:58
notagoodidea moritz: ok thanks, seems the most general-ish module so. 11:14
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
infix stopper
postfix
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
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 )
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
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
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
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
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
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
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
guifa2 I think if we beefed up Uni a bit more it might help 15:52
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 :-)
guifa2 maandag 28 december 2020 om 10:50:04 Eastern-standaardtijd 15:54
lizmat guifa2: that's just because the Dutch massively ignored using the en.wikipedia.org/wiki/IJ_(digraph) 15:58
:-)
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
Geth doc: e1d25c0e06 | (JJ Merelo)++ | documentable.json
Adds configuration, refs #3753, Raku/Documentable#146
17:05
linkable6 DOC#3753 [open]: github.com/Raku/doc/issues/3753 [site][❗Blocker❗] Pencil symbol links to a 404 on Github
notagoodidea m: my $foo = 3; say "$foo" given $foo; 17:11
camelia 3
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
17:14
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]
notagoodidea sorry wild middle click paste jumped in the chat. 17:43
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
18:27
linkable6 DOC#3753 [closed]: github.com/Raku/doc/issues/3753 [site][❗Blocker❗] Pencil symbol links to a 404 on Github
lizmat and the last Rakudo Weekly News of 2020 hits the Net: rakudoweekly.blog/2020/12/28/2020-...evolution/ 18:56
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
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:45
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)
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
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