🦋 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.
tbrowder is there a way to avoid precomp for debugging modules? 00:09
lizmat: i'm getting an error using P5pack and it seems it's due to my caller but i can't locate the entry 00:10
on my side 00:13
wait a mo, time to break out jnthn's debugger! 00:14
Xliff m: class A ( has $!a is built; has $.b }; A.new(a => 42, b => 'meow').gist.say 00:27
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse class definition
at <tmp>:1
------> 3class A7⏏5 ( has $!a is built; has $.b }; A.new(a
expecting any of:
generic role
Xliff m: class A { has $!a is built; has $.b }; A.new(a => 42, b => 'meow').gist.say 00:28
camelia A.new(a => 42, b => "meow")
Xliff m: class A { has $!a is built; has $1b }; A.new(a => 42, b => 'meow').gist.say
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot declare a numeric variable
at <tmp>:1
------> 3class A { has $!a is built; has $17⏏5b }; A.new(a => 42, b => 'meow').gist.sa
Xliff m: class A { has $!a is built; has $!b }; A.new(a => 42, b => 'meow').gist.say
camelia A.new(a => 42)
tbrowder lizmat: problem was p5 prog was using following pack call: pack(C => 0xAD) and pack was reporting that as one arg instead of two. i changed call to form: pack(" 00:39
*pack('C', 0xAD) which was accepted. 00:40
fyi, original p5 code is at least 5 but mostly 10 years old. 00:42
rypervenche How can I get a character, for example "\x9F9C", which is 龜, from a string of just the hex number 9F9C? I've tried something like this, but it doesn't work: say "\x[$_]" for "9F9C"; 01:14
tbrowder issue filed
m: say \x[9f9c] 01:16
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3say \x[97⏏5f9c]
expecting any of:
whitespace
tbrowder m: say "\x[9f9c]"
camelia
rypervenche I can't figure out how to get the number inside of the [] from a variable. 01:17
tbrowder m: 01:18
evalable6
tbrowder i think you have to do some magic...let me see if i can find some old code... 01:19
tbrowder i found it...give me a few minutes to gist it 01:24
rypervenche Thanks for taking the time to help. 01:26
tbrowder my pleasure (if it works for you--we'll see)... 01:27
Xliff m: "\x[9f9c]".^name.say; 01:29
camelia Str
Xliff m: "\x[9f9c]".ord.say;
camelia 40860
Xliff m: "\x[9f9c]".uniname.say;
camelia CJK UNIFIED IDEOGRAPH-9F9C
Xliff m: 40860.fmt('%x').say 01:30
camelia 9f9c
Xliff m: "\x[9f9c]b".chars.say;
camelia 2
Xliff m: "\x[9f9c]b\x[9f9b]".chars.say;
camelia 3
Xliff m: "\x[9f9c]b\x[9f9b]".say
camelia 龜b龛 01:31
Xliff .ord.say for "\x[9f9c]b\x[9f9b]".chars
evalable6 51
Xliff .ord.say for "\x[9f9c]b\x[9f9b]".split
m: .ord.say for "\x[9f9c]b\x[9f9b]".split
camelia Cannot resolve caller split(Str:D: ); none of these signatures match:
(Str:D: Regex:D $regex, $limit is copy = Inf;; :$v, :$k, :$kv, :$p, :$skip-empty, *%_ --> Seq:D)
(Str:D: Str(Cool) $match;; :$v is copy, :$k, :$kv, :$p, :$skip-empty, *%…
Xliff m: .ord.say for "\x[9f9c]b\x[9f9b]".split()
camelia Cannot resolve caller split(Str:D: ); none of these signatures match:
(Str:D: Regex:D $regex, $limit is copy = Inf;; :$v, :$k, :$kv, :$p, :$skip-empty, *%_ --> Seq:D)
(Str:D: Str(Cool) $match;; :$v is copy, :$k, :$kv, :$p, :$skip-empty, *%…
Xliff m: .ord.say for "\x[9f9c]b\x[9f9b]".comb
camelia 40860
98
40859
01:32
Xliff ^^ rypervenche
m: .ord.say for "\x[9f9c]b\x[9f9b]".encode
camelia 50
49
49
57
50
49
49
rypervenche I'm starting with just "9f9c", not "\x9f9c" though.
I'm sourcing a file that has "%u9f9c" and need to turn it into 龜 ultimately. 01:33
Xliff Are you always given two bytes or is this a stream
rypervenche Sometimes it's multiple characters together.
Xliff So the file always has "%u<b><b>"? 01:34
rypervenche Yes, or a number of them concatenated together.
tbrowder the gist i'll point to in a minute hasn't been cleaned up but it was used to help me make a PR for rakudo to handle some special unicode space chars. 01:35
it may have what you need in some part of it. just execute it as is and see.
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s/'%u'(..)/\x$1/; $a.say
camelia 5===SORRY!5=== Error while compiling <tmp>
Unrecognized backslash sequence: '\x'
at <tmp>:1
------> 3"%u9f9c%u9f9b%u9f9d"; $a ~~ s/'%u'(..)/\7⏏5x$1/; $a.say
expecting any of:
infix stopper
single quotes
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s/'%u'(..)/\\x$1/; $a.say 01:36
camelia Use of Nil in string context
\x9c%u9f9b%u9f9d
in code at <tmp> line 1
tbrowder the gist: gist.github.com/tbrowder/1312dd697...94e1286434
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(..)/\\x$1/; $a.say
camelia Use of Nil in string context
\x9c\x9b\x9d
in code at <tmp> line 1
Use of Nil in string context
in code at <tmp> line 1
Use of Nil in string context
in code at <tmp> line 1
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/\\x$1/; $a.say
camelia Use of Nil in string context
\x\x\x
in code at <tmp> line 1
Use of Nil in string context
in code at <tmp> line 1
Use of Nil in string context
in code at <tmp> line 1
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/\\x[$1]/; $a.say
camelia Use of Nil in string context
\x[]\x[]\x[]
in code at <tmp> line 1
Use of Nil in string context
in code at <tmp> line 1
Use of Nil in string context
in code at <tmp> line 1
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/\\x[$0]/; $a.say
camelia \x[9f9c]\x[9f9b]\x[9f9d]
tbrowder let me know if that helps 01:37
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/\\x[$0]/; "$a".say
camelia \x[9f9c]\x[9f9b]\x[9f9d]
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/x[$0]/; "$a".say 01:38
camelia x[9f9c]x[9f9b]x[9f9d]
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/\x[$0]/; "$a".say 01:39
camelia 5===SORRY!5=== Error while compiling <tmp>
Unrecognized backslash sequence: '\x'
at <tmp>:1
------> 3c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/\x[7⏏5$0]/; "$a".say
expecting any of:
hex character
infix stopper
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/\x\[$0\]/; "$a".say
camelia 5===SORRY!5=== Error while compiling <tmp>
Unrecognized backslash sequence: '\x'
at <tmp>:1
------> 3f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/\7⏏5x\[$0\]/; "$a".say
expecting any of:
infix stopper
single quotes
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/{ chr($0) }/; "$a".say 01:40
camelia Cannot convert string to number: trailing characters after number in '039⏏5f9c' (indicated by ⏏)
in code at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/{ chr($0.fmt('%d).Int) }/; "$a".say
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in single quotes; couldn't find final "'" (corresponding starter was at line 1)
at <tmp>:1
------> 3...)/{ chr($0.fmt('%d).Int) }/; "$a".say7⏏5<EOL>
expecting …
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/{ chr($0.fmt('%d).Int) }/; "$a".say
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in single quotes; couldn't find final "'" (corresponding starter was at line 1)
at <tmp>:1
------> 3...)/{ chr($0.fmt('%d).Int) }/; "$a".say7⏏5<EOL>
expecting …
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/{ chr($0.fmt('%d').Int) }/; "$a".say
camelia Cannot stringify this object of type VMArray (BOOTArray)
in code at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/{ chr($0.Int.fmt('%d')) }/; "$a".say
camelia Cannot stringify this object of type VMArray (BOOTArray)
in code at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff Well, that's weird. 01:41
m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/{ $0.Int }/; "$a".say
camelia Cannot convert string to number: trailing characters after number in '039⏏5f9c' (indicated by ⏏)
in code at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/{ $0.Str.,Int }/; "$a".say
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed postfix call
at <tmp>:1
------> 3b%u9f9d"; $a ~~ s:g/'%u'(....)/{ $0.Str.7⏏5,Int }/; "$a".say
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/{ $0.Str.Int }/; "$a".say 01:42
camelia Cannot convert string to number: trailing characters after number in '039⏏5f9c' (indicated by ⏏)
in code at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/{ $0.say }/; "$a".say
camelia 「9f9c」
「9f9b」
「9f9d」
TrueTrueTrue
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/{ $0.Int.say }/; "$a".say
camelia Cannot convert string to number: trailing characters after number in '039⏏5f9c' (indicated by ⏏)
in code at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/{ $0.Str.say }/; "$a".say
camelia 9f9c
9f9b
9f9d
TrueTrueTrue
Xliff m: my $a = "%u9f9c%u9f9b%u9f9d"; $a ~~ s:g/'%u'(....)/{ $0.Str.fmt('%x').say }/; "$a".say
camelia Cannot stringify this object of type VMArray (BOOTArray)
in code at <tmp> line 1
in block <unit> at <tmp> line 1
rypervenche Oh geez... 01:43
m: say ("0x" ~ $_).chr for "9f9c";
camelia
Xliff Hah!
rypervenche tbrowder: Thanks. That put me in the right direction.
tbrowder good deal! raku is kool, but i have trouble getting my head around the fact that all integers become decimal in native form regardless of how we input them. then we can show them in different base. 01:52
*bases
Geth doc: 66c0269c26 | cfa++ | 2 files
Learn a code word; fix typo.
04:50
Geth doc: f299cff716 | Tinmarino++ | 5 files
Rename: Perl 5 -> Perl (about)
07:19
doc: 1291bd1661 | Tinmarino++ | doc/Language/traps.pod6
Tipo
doc: 53cdd98060 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | 5 files
Merge pull request #3277 from tinmarino/merge_perl5_5

Rename: Perl 5 -> Perl (about) (5/6)
linkable6 Link: docs.raku.org/language/traps
doc: eec5c7aae1 | Tinmarino++ | 6 files
Rename: Perl 5 -> Perl (in 5to6)
07:21
doc: 152bed7e7e | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | 6 files
Merge pull request #3273 from tinmarino/merge_perl5_1

Change Perl 5 to Perl (1/6) Thanks!
stoned75 m: say "abcde".comb(/./, :match) 08:30
camelia (「a」 「b」 「c」 「d」 「e」)
kawaii Hello, I seem to be having an issue where a live supply is feeding me historical events from a tap? :) 14:35
github.com/myisha/p6-zoe-voteban/b...p6#L57-L83
The two `add-reaction` events from the first block of code are being picked up by the listener in the second block and we're not sure why :)
Even if I were to add a lengthy break, such as a sleep for 5 seconds, between the two blocks, the historical events are still captured
github.com/shuppet/p6-api-discord/...e.pm6#L150 <- here is where the tap is created in the module we're using 14:36
Geth doc: 658059184d | Coke++ | 2 files
whitespace
14:41
doc: 14468dfb7e | Coke++ | doc/Language/objects.pod6
fix example compilation
doc: 0588b51f94 | Coke++ | xt/headings.t
allow capitalized Perl in headings
linkable6 Link: docs.raku.org/language/objects
Geth doc: Kaiepi++ created pull request #3279:
Document how `is raw` behaves with slurpy list parameters
15:18
Geth doc: 4e84900c2d | (Tom Browder)++ (committed using GitHub Web editor) | doc/Type/IO/Spec/Unix.pod6
Correct typo
15:58
linkable6 Link: docs.raku.org/type/IO::Spec::Unix
jdv79 [Coke]: when did you stop commuting down here? 16:27
i started wfh on the 11th 16:28
[Coke] I was in NYC March 2-3, basically sprinted out of the city that afternoon. 16:41
(barely caught the subway to penn station, had to run through the concourse there to catch my train)
Got out just in time, I think.
while i was there, $dayjob had already started cancelling non-essential travel, now it's *all* shutdown.
rbt Weird. 18:13
echo "message" | r -e 'use v6d; sub MAIN() {my $msg = slurp(:bin); say $msg.^name;}'
OUT: Str
echo "message" | r -e 'use v6d; my $msg = slurp(:bin); say $msg.^name;'
OUT: Buf[uint8]
r --version 18:14
This is Rakudo version 2020.02.1 built on MoarVM version 2020.02.1
implementing Raku 6.d.
[Coke] m: sub MAIN() { say $*ARGFILES.^name} 18:19
camelia IO::ArgFiles
[Coke] m: say $*ARGFILES.^name 18:20
camelia IO::Handle
[Coke] rbt: ^^
Doc_Holliwood muh. why can't I have "123".tail, why do i have to write "123".substr(*-1,1) ? 18:21
rbt So I guess slurp(:bin) on Argfiles isn't a :bin result?
Doc_Holliwood whining from a high horse I know =) 18:22
rbt Still seems unexpected. 18:23
Geth doc: 7fd74bb9c1 | Coke++ | 2 files
Update some executable invocations
18:26
doc: 42534ccdde | Coke++ | doc/Type/independent-routines.pod6
Update some compiler language names
linkable6 Link: docs.raku.org/type/independent-routines
[Coke] rbt: yah, that could still be a bug, just giving you more deets. 18:27
*details
rbt Thanks. I've started on an issue submission. 18:28
[Coke] m: "123".comb.tail
camelia ( no output )
[Coke] m: "123".comb.tail.say
camelia 3
[Coke] Doc_Holliwood: ^^
rbt++ 18:29
Doc_Holliwood I know Coke. 18:30
why is it that Coke from a small glass bottle tastes so much better than from a 1.5l PET? 18:31
[Coke] in some cases, different sweetener. 18:32
Doc_Holliwood There are no cases. I only drink Classic 18:35
Everything else is devils work
[Coke] different regions can have different bottlers; but if it's all the same bottler, than I don't know why the glass tastes better. I prefer cans, these days 18:36
I am 100% team Coke Zero these days
Doc_Holliwood heretic!
[Coke] In the states, we occasionally get "mexican coke" which cane sugar instead of HFCS. 18:37
eh. for a while it was even caff. free.
diabetes and tachycardia restrict my options sometimes. :)
thundergnat m: say "123".substr(*-1) # FWIW, if you only want the last character(s), you don't need to supply a second argument
camelia 3
Doc_Holliwood really, I tried that. 18:38
at least I think I did
allright, cool.
thanks
thundergnat Also, maybe check out modules.raku.org/search/?q=String%3A%3ASplice for your string slicing and dicing needs. (shameless plug) 18:39
Doc_Holliwood yeah, diabetes sucks. i would collapse without ready sugar. my whole organism runs on it 18:41
m: multi sub infix:<*>( Block $b, Int $i ) { &$b($_) for ^$i; }; { .say } * 3 19:01
camelia WARNINGS for <tmp>:
0
1
2
Useless use of "*" in expression "{ .say } * 3" in sink context (line 1)
Doc_Holliwood m: multi sub infix:<*>( Block $b, Int $i ) { &$b($_) for ^$i; }; $ = { .say } * 3
camelia 0
1
2
Doc_Holliwood how do i get rid of that sink error?
jjatria I'm using NativeCall and I have a function that returns a Pointer[CStruct], but if I try to modify it like I would do in C, I get an error saying it is immutable. Is there a way to make it mutable? 19:04
The function in question: gitlab.com/jjatria/raku-termbox/-/...6#L201-202
Geth doc: uzluisf++ created pull request #3281:
Document that Str.contains now also can take a Regex
20:22
AlexDaniel it can?? 20:23
what! 20:24
jnthn Can it?
AlexDaniel m: say ‘foo’.contains(/f./)
jnthn Why?
camelia True
AlexDaniel 6c: say ‘foo’.contains(/f./)
committable6 AlexDaniel, gist.github.com/5e6f433a9d0bd57dd9...a49b5fef04
AlexDaniel let's see… 20:25
bisect: say ‘foo’.contains(/f./)
bisectable6 AlexDaniel, Bisecting by exit code (old=2015.12 new=efab398). Old exit code: 1
AlexDaniel, bisect log: gist.github.com/1971a5eb895e96ee78...1c73c1c3c6
AlexDaniel, (2020-02-06) github.com/rakudo/rakudo/commit/c3...f2367ba17c
jnthn Ah, hm. 20:26
Well yeah, I guess that saves also populating $/
AlexDaniel jnthn: interesting, yeah, it's a long-standing issue that whenever you needed a regex you'd end up with sloooow code because of the match objects
so I guess that's now fixed?
jnthn Well, in the case you only want to ask "does this match somewhere" and have no further info on where... 20:27
AlexDaniel I remember there was a discussion about this, but somehow “just make .contains accept regexes” wasn't a good option 20:28
jnthn I'd not assume any particular speedup without measuring though.
You don't get rid of the overhead of setting up the regex engine, for example.
AlexDaniel github.com/rakudo/rakudo/issues/2268 20:29
“Personally, I found the addition of .contains, .starts-with, and friends a bit frivolous, but now that those string-searching methods are here, it seems almost obvious to let them accept all regex adverbs that make logical sense for them.” 20:32
heh
lizmat and another Rakudo Weekly news hits the Net: rakudoweekly.blog/2020/03/23/2020-...ification/ 20:34
Geth doc: 0ac130fe92 | (Luis F. Uceta)++ | 2 files
Document that Str.contains now also can take a Regex

refs: github.com/Raku/doc/issues/3229
20:36
doc: ee9a576a7b | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | 2 files
Merge pull request #3281 from uzluisf/master

Document that Str.contains now also can take a Regex
AlexDaniel lizmat: nice weekly! 20:41
Doc_Holliwood can i iterate a shaped array shape-wise? 20:47
AlexDaniel lizmat: did you want to say that .contains now accepts a regex? :) 20:50
chloekek p6: .say for <a b> Xx <2 3> 21:46
camelia aa
aaa
bb
bbb
chloekek p6: .say for <a b> Xxx <2 3>
camelia (a a)
(a a a)
(b b)
(b b b)
chloekek p6: say [×] # get 1 but only use characters consisting of straight lines 22:00
camelia 1
chloekek p6: say [+] 22:01
camelia 0
chloekek p6: say [+] eqv ([×]) - [×]
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
eqv used at line 1
chloekek Ah the precedence of [×] is quite annoying for that purpose. 22:02
p6: say [[×]][[+]] - [×]
camelia 0
tobs p6: say ([+]) eqv ([×]) - [×] 22:03
camelia True
chloekek (…) are not straight lines, but […][[+]] is ok
Similar to the Perl solution by D. Conway: […]->[//] 22:04
tobs oh, wasn't aware of what you're doing
chloekek p6: say [[×]][[+]] - $_ for (0, 1) # logical not 22:07
camelia 1
0
chloekek Combine with | to get logical nor, and now you can make all logic gates. 22:08
I mean ||
What’s cool is that Z and X are allowed :) 22:10
MasterDuke fyi, a HN thread about strings and how unicode is hard that doesn't yet have a raku comment news.ycombinator.com/item?id=22652130 22:25
cpan-raku New module released to CPAN! Colorizable (0.1.0) by 03UZLUISF 23:09