»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
00:00 lizmat joined, p6bannerbot sets mode: +v lizmat 00:06 cognominal-p6 left 00:10 rindolf left 00:14 leont left, ryn1x joined 00:15 p6bannerbot sets mode: +v ryn1x 00:18 lizmat left 00:19 ryn1x left 00:20 ryn1x joined, p6bannerbot sets mode: +v ryn1x 00:21 w_richard_w joined 00:22 p6bannerbot sets mode: +v w_richard_w 00:30 kst joined, cognominal-p6 joined, p6bannerbot sets mode: +v kst 00:31 cognominal-p6 left, cognominal-p6 joined 00:32 p6bannerbot sets mode: +v cognominal-p6 00:48 ryn1x left 00:51 jh001 left 00:53 jh001 joined 00:54 p6bannerbot sets mode: +v jh001 00:56 MasterDuke joined, p6bannerbot sets mode: +v MasterDuke, MasterDuke left, MasterDuke joined, herbert.freenode.net sets mode: +v MasterDuke, p6bannerbot sets mode: +v MasterDuke 00:57 mantovani left, Mithaldu left 00:58 Mithaldu joined, p6bannerbot sets mode: +v Mithaldu 00:59 mantovani joined 01:00 p6bannerbot sets mode: +v mantovani 01:02 aindilis left 01:03 oodani left, aindilis joined, oodani joined, p6bannerbot sets mode: +v aindilis 01:04 p6bannerbot sets mode: +v oodani, fake_space_whale joined 01:05 p6bannerbot sets mode: +v fake_space_whale 01:07 Kaiepi left, Kaiepi joined 01:08 p6bannerbot sets mode: +v Kaiepi 01:18 kerframil left 01:33 Guest13389 left 01:46 Guest13389 joined 01:47 Ven` joined, p6bannerbot sets mode: +v Guest13389, p6bannerbot sets mode: +v Ven` 01:50 donaldh left 01:51 donaldh_ joined, Ven` left, p6bannerbot sets mode: +v donaldh_ 01:53 molaf left 02:05 molaf joined 02:06 p6bannerbot sets mode: +v molaf 02:10 ufobat_ joined, p6bannerbot sets mode: +v ufobat_ 02:13 ufobat left 02:18 w_richard_w left
SmokeMachine I was reading the post about exportable (www.0racle.info/articles/exportatio...ploration) and was trying to implement that... 02:40
and I got an output that I can't understand...
my code is: gist.github.com/FCO/a61fbbcf0a498f...419b3325fb 02:41
m: gist.github.com/FCO/a61fbbcf0a498f...419b3325fb
camelia 5===SORRY!5=== Error while compiling <tmp>
Preceding context expects a term, but found infix = instead.
Did you make a mistake in Pod syntax?
at <tmp>:1
------> 3Hash[Routine] %funcs =7⏏5 (my Routine %)
SmokeMachine m: gist.github.com/FCO/a61fbbcf0a498f...419b3325fb 02:42
camelia ===SORRY!===
Could not find Bla at line 2 in:
/home/camelia
/home/camelia/.perl6
/home/camelia/rakudo-m-inst-1/share/perl6/site
/home/camelia/rakudo-m-inst-1/share/perl6/vendor
/home/camelia/rakudo-m-inst-1/share/perl6…
geekosaur doesn'tt hat type have to be something like Hash{Routine} instead of square brackets? 02:45
SmokeMachine geekosaur: camelia was trying to compile the file with the output... 02:48
geekosaur: what I can't get is: the %funcs seems to be populated... why the `say "exported-EXPORT: @funcs[]; %funcs<>";` says it isn't? 02:50
geekosaur looks to me like you are producing a reference to a sub that needs a 'my' variable. whose value doesn't exist any more because sub EXPORT has returned 02:56
pretty sure it can't close over %funcs just because you returned a reference to a sub object that uses it 02:57
probably need either "our", or some other way carry the scope with exported-EXPORT. possibly use the assuming method to pass it in? 02:59
SmokeMachine geekosaur: that makes sense... 03:04
geekosaur: thanks! 03:05
geekosaur: using assuming didn't help... but the error changed... 03:07
now it dies with:
www.irccloud.com/pastebin/PAMwEWAB/
there's no `$res` on my code
geekosaur well, that sounds like it at least tried, but wasn't expecting what you did. I had been wondering how it would deal with that, tbh 03:08
might have to unroll it into the call since it again doesn't exist. ($res is probably from the hackery 'assuming' does) 03:09
yes, it is. and that hackery is …fragile 03:12
(it's sprintf-ing an anon sub and EVAL-ing it. ick) 03:13
so something went wrong generatingt he anon sub and its internal $res ended up out of scope 03:14
might be easier to return an anon sub yourself. 'EXPORT' => sub { exported-EXPORT(%funcs) } # ? 03:15
.oO { if you like sausages, politics, or rakudo, don't look at any of them being made } 03:18
SmokeMachine :) 03:20
it's working! 03:33
03:33 MasterDuke left 03:41 sauvin joined, p6bannerbot sets mode: +v sauvin
SmokeMachine geekosaur: gist.github.com/FCO/18bbbbe640d7f8...b612ceec3d 03:55
03:56 noganex left, noganex_ joined 03:57 p6bannerbot sets mode: +v noganex_
Xliff m: use NativeCall; class A is repr('CStruct') { has uint32 $.a }; my Pointer[A] $pa = nativecast(Pointer[A], $a.new); say $pa; 03:59
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared
at <tmp>:1
------> 3Pointer[A] $pa = nativecast(Pointer[A], 7⏏5$a.new); say $pa;
Xliff m: use NativeCall; class A is repr('CStruct') { has uint32 $.a }; my Pointer[A] $pa = nativecast(Pointer[A], A.new); say $pa;
camelia NativeCall::Types::Pointer[A]<0x5471150>
04:00 Possum left
Xliff m: use NativeCall; class A is repr('CStruct') { has uint32 $.a }; my Pointer[A] $pa = nativecast(Pointer[A], A.new(:a = 32); say $pa; $pa.deref.gist.say 04:00
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use variable $pa in declaration to initialize itself
at <tmp>:1
------> 3vecast(Pointer[A], A.new(:a = 32); say $7⏏5pa; $pa.deref.gist.say
expecting any of:
argument lis…
Xliff m: use NativeCall; class A is repr('CStruct') { has uint32 $.a }; my Pointer[A] $pa = nativecast(Pointer[A], A.new(:a = 32)); say $pa; $pa.deref.gist.say
camelia Cannot modify an immutable Pair (a => True)
in block <unit> at <tmp> line 1
Xliff m: use NativeCall; class A is repr('CStruct') { has uint32 $.a }; my Pointer[A] $pa = nativecast(Pointer[A], A.new(:!a = 32)); say $pa; $pa.deref.gist.say
camelia Cannot modify an immutable Pair (a => False)
in block <unit> at <tmp> line 1
Xliff m: use NativeCall; class A is repr('CStruct') { has uint32 $.a = 32 }; my Pointer[A] $pa = nativecast(Pointer[A], A.new); say $pa; $pa.deref.gist.say 04:01
camelia NativeCall::Types::Pointer[A]<0x3acae80>
A.new(a => 32)
04:38 Ven` joined 04:39 p6bannerbot sets mode: +v Ven` 04:42 Ven` left 04:45 Lili joined, p6bannerbot sets mode: +v Lili 04:47 Lili left 04:52 curan joined, p6bannerbot sets mode: +v curan 04:57 ChoHag left 05:02 xi- left, m0ltar left 05:07 m0ltar joined, Elronnd joined, xi- joined, p6bannerbot sets mode: +v m0ltar 05:08 p6bannerbot sets mode: +v Elronnd, p6bannerbot sets mode: +v xi- 05:23 jmerelo joined, p6bannerbot sets mode: +v jmerelo 05:40 Ven` joined 05:41 p6bannerbot sets mode: +v Ven` 05:45 Ven` left 05:46 Xliff_ joined 05:47 cbk_ joined, p6bannerbot sets mode: +v Xliff_, leedo left, p6bannerbot sets mode: +v cbk_ 05:48 a3f_ joined 05:49 diego_k joined, p6bannerbot sets mode: +v a3f_, sauvin_ joined, p6bannerbot sets mode: +v sauvin_, p6bannerbot sets mode: +v diego_k 05:50 kentnl joined, p6bannerbot sets mode: +v kentnl, oftl_ joined, syntaxma1 joined, TimToady_ joined, mingdao_ joined, p6bannerbot sets mode: +v mingdao_, [Coke]_ joined, [Coke]_ left, [Coke]_ joined, p6bannerbot sets mode: +v [Coke]_ 05:51 p6bannerbot sets mode: +v oftl_, p6bannerbot sets mode: +v syntaxma1, chsanch_ joined, p6bannerbot sets mode: +v TimToady_, p6bannerbot sets mode: +v [Coke]_, p6bannerbot sets mode: +v chsanch_ 05:54 kanbas- joined, exodist_ joined, Xliff_ left, Summertime2 joined, p6bannerbot sets mode: +v Summertime2 05:55 p6bannerbot sets mode: +v kanbas-, p6bannerbot sets mode: +v exodist_, giraffe joined, p6bannerbot sets mode: +v giraffe, samcv_ joined, p6bannerbot sets mode: +v samcv_, sauvin left, Xliff left, phogg left, Spooktober left, kent\n left, chsanch left, mingdao left, diegok left, Summertime left, Guest86558 left, APic left, emerson left, Exodist left, syntaxman left, oftl left, kanbas left, cbk1090 left, TimToady left, camelia left, SqrtNegInf left, a3f left, samcv left, [Coke] left, raydiak_ left, exodist_ is now known as Exodist 05:56 Spooktober joined, p6bannerbot sets mode: +v Spooktober 05:58 m0ltar left, Mithaldu left 06:00 m0ltar joined 06:01 p6bannerbot sets mode: +v m0ltar 06:02 Mithaldu joined, marmay joined, phogg joined, p6bannerbot sets mode: +v phogg, p6bannerbot sets mode: +v Mithaldu, raydiak_ joined, p6bannerbot sets mode: +v marmay 06:03 APic joined, p6bannerbot sets mode: +v raydiak_, p6bannerbot sets mode: +v APic 06:06 camelia joined, samcv_ is now known as samcv, p6bannerbot sets mode: +v camelia 06:08 sauvin_ is now known as Sauvin 06:13 troys left 06:15 chsanch_ left 06:16 chsanch joined 06:17 p6bannerbot sets mode: +v chsanch 06:26 random_yanek joined, p6bannerbot sets mode: +v random_yanek 06:28 fake_space_whale left 06:30 TimToady_ is now known as TimToady, TimToady left, TimToady joined, livingstone.freenode.net sets mode: +v TimToady, p6bannerbot sets mode: +v TimToady 06:33 ufobat_ is now known as ufobat 06:39 jmerelo left 06:43 domidumont joined 06:44 p6bannerbot sets mode: +v domidumont 06:47 domidumont left
xinming Since <> is decont operation, What is [] then? 06:48
[] is still decont op?
What are the differences between <> and [] ?
06:53 robertle joined, p6bannerbot sets mode: +v robertle 07:02 domidumont joined 07:03 p6bannerbot sets mode: +v domidumont
moritz <> is also a quoting construct, and magical in other ways 07:09
m: say <a b>.perl
camelia ("a", "b")
moritz m: say [a b].perl
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routines:
a used at line 1
b used at line 1
07:19 haukex joined 07:20 p6bannerbot sets mode: +v haukex
xinming moritz: So, when [] and <> both used in postfix. 07:33
they are the same, right?
What I mean is, I read perl6advent.wordpress.com/2017/12/02/ it says <> is decont operation. 07:34
and I found that $list[] can also do "decont" over list.
07:35 rba joined, p6bannerbot sets mode: +v rba
rba Where can I find rakudo star windows binaries as zip file? I found only the msi. 07:36
07:47 finanalyst joined 07:48 p6bannerbot sets mode: +v finanalyst
chsanch rba: github.com/rakudo/star/releases 07:48
moritz xinming: ah, you mean empty <> and [] as "zen slice". Yes, should both be the same 07:50
rba chsanch: so, the message is, to build it myself? 07:51
moritz rba: I think so, yes :( 07:53
rba: I'm curious, what's your use case of zip over MSI?
chsanch rba: probably is the best option, not sure why you can't use MSI 07:54
rba moritz: Sitting in front of enterprise windows, where I'm not allowed to install msi myself.
moritz: So I will install the msi on my private machine and then smuggle the binaries on that system, I guess...
chsanch rba: www.codetwo.com/kb/msi-from-exe/ maybe with 7-Zip (I don't use windows, so not sure if that could work) 07:56
finanalyst good time-of-day. Having a problem with CompUnit::Repository. The repository is providing an old handle even when :since is set. I think this is a bug, but I wanted to check. Pastebin of code and result pastebin.com/wtA9a0nP 07:58
moritz rba: but can you install files to C:\rakudo in your enterprise windows? 08:00
rba chsanch: Tried to unzip it using 7-zip already, yet all the files have filenames like "fil<hex-uniq-id>".
El_Che moritz: colleagues using Windows use lots of portable apps (because their installations are restricted to sillyness).
moritz rakudo is not relocatable :(
El_Che but the not relocatable thing makes this argument moot
El_Che is a Linux rebel at work, with an illegal OS on his laptop :) 08:01
rba moritz: so then I'm lost anyway. I have no rights to write to c:\ 08:02
El_Che it sounds like we work on the same place or we have the same crappy desktop admins :) 08:03
rba: you'll need to compile to a directory where you have rw access to
typically, something stupid like Document or MyApps
08:07 donaldh_ left, donaldh joined 08:08 p6bannerbot sets mode: +v donaldh 08:09 lizmat joined, p6bannerbot sets mode: +v lizmat
rba El_Che: got it. will first try to find out, from which location I'm allowed to run binaries. Then I will try to build it on my personal notebook and try to relocate the binaries to the companies machine. 08:10
El_Che yes, in the same location
08:19 Spooktober left 08:20 donaldh left, donaldh_ joined 08:21 p6bannerbot sets mode: +v donaldh_ 08:22 Spooktober joined, p6bannerbot sets mode: +v Spooktober 08:23 vike1 left 08:24 vike joined 08:25 p6bannerbot sets mode: +v vike 08:32 rba_ joined 08:33 p6bannerbot sets mode: +v rba_ 08:34 zakharyas joined, rindolf joined 08:35 rba left, p6bannerbot sets mode: +v zakharyas, p6bannerbot sets mode: +v rindolf, robertle left 08:37 robertle joined 08:38 p6bannerbot sets mode: +v robertle, noganex joined 08:39 p6bannerbot sets mode: +v noganex 08:42 noganex_ left 08:54 robertle left 08:56 robertle joined 08:57 p6bannerbot sets mode: +v robertle 09:03 sena_kun joined 09:04 p6bannerbot sets mode: +v sena_kun 09:07 pmurias joined, p6bannerbot sets mode: +v pmurias 09:28 haukex left 09:30 haukex joined 09:31 p6bannerbot sets mode: +v haukex, pecastro joined 09:32 p6bannerbot sets mode: +v pecastro 09:39 cognominal-p6 left
donaldh_ code golf, building mountains: codegolf.stackexchange.com/a/174735/66624 09:43
09:56 kst left 10:14 finanalyst left
xinming moritz: Thanks for the clarification. 10:18
10:19 cognominal-p6 joined 10:20 p6bannerbot sets mode: +v cognominal-p6 10:22 cognominal-p6 left, cognominal-p6 joined 10:23 p6bannerbot sets mode: +v cognominal-p6 10:31 Zoffix joined, p6bannerbot sets mode: +v Zoffix 10:34 kensanata joined, p6bannerbot sets mode: +v kensanata
Zoffix xinming: that article lists <> as decont, simply 'cause it's easy to remember (it looks like a squished box) and unlike `[]` zen slice that's often used to interpolate `@-` vars in strings, the `<>` is seldom used. The reason `<>` or `[]` work as decont is they simply return `self`, so even a `.self` method call will decont. 10:34
xinming: also, they're currently not the same. `[]` caches the Seq, while `<>` doesn't. The `[]` was made to cache very recently, and now I'm questioning whether it was right... 10:36
10:36 AlexDaniel left
Zoffix will open an Issue, but will default to reverting the caching of `[]` 10:36
10:37 leont joined, p6bannerbot sets mode: +v leont
Zoffix decides to just revert it 10:38
(it's 7-days old only)
xinming: oh, and the whole "self" thing works because `self` inside methods is automatically deconted (unless it's a Proxy) 10:40
m: sub postfix:<🥡> { $^a<> }; my $s = (1, 2, 3); .say for $s🥡 10:49
camelia 1
2
3
Geth doc: d2e99cc0e3 | (Zoffix Znet)++ | doc/Language/subscripts.pod6
Fix up ZEN slicing on Seqs

The caching behaviour (R#2383[^1]) was reverted[^2][^3] and non-caching behaviour propspeced[^4]
  [1] github.com/rakudo/rakudo/issues/2383
  [2] github.com/rakudo/rakudo/commit/2efffc2b43
  [3] github.com/perl6/roast/commit/5485affa47
  [4] github.com/perl6/roast/commit/f5f9ce0083
10:57
synopsebot Link: doc.perl6.org/language/subscripts
synopsebot R#2383 [closed]: github.com/rakudo/rakudo/issues/2383 [consistency][testneeded] .[] doesn't cache a Seq
Zoffix .tell AlexDaniel` I merged my post-release branches 'cause I recall you saying we could do whatever on master now, but perhaps you'd like to cherry-pick github.com/rakudo/rakudo/commit/2efffc2b43 because original commit ain't on any release. Also, it's possible the original commit introed a memory leak bug in some code that uses `[]` to decont a large Seq 11:04
yoleaux Zoffix: I'll pass your message to AlexDaniel`.
Zoffix Merci, roboto! 11:05
11:09 zakharyas left 11:13 Zoffix left 11:28 rba_ left 11:37 AlexDaniel joined, p6bannerbot sets mode: +v AlexDaniel
AlexDaniel` . 11:41
yoleaux 11:04Z <Zoffix> AlexDaniel`: I merged my post-release branches 'cause I recall you saying we could do whatever on master now, but perhaps you'd like to cherry-pick github.com/rakudo/rakudo/commit/2efffc2b43 because original commit ain't on any release. Also, it's possible the original commit introed a memory leak bug in some code that uses `[]` to decont a large Seq
El_Che releasable6: status 11:46
releasable6 El_Che, Next release will happen when it's ready. 1 blocker. 492 out of 514 commits logged
El_Che, Details: gist.github.com/2cdc187e62ef613b85...60c5ede495
12:02 atroxaper joined 12:03 p6bannerbot sets mode: +v atroxaper 12:05 molaf left
atroxaper Hello, #perl6 ! 12:07
kensanata yo 12:09
atroxaper It's me again :) Yesterday I asked about wrap and signatures (stackoverflow.com/questions/529898...wrap-sub). Today I have try to find a workaround and found that it is not because wrap but because CALL-ME method;
sub s(:$arg) {}; say %(:arg(3)) ~~ &s.signature; say &s.^find_method('CALL-ME'); &s does role r { submethod CALL-ME(|) {} }; say %(:arg(3)) ~~ &s.signature; say &s.^find_method('CALL-ME');
evalable6 True
(Mu)
False
CALL-ME
atroxaper I tried to find CALL-ME method in the compiler code. As I understand the method is 'not real' for most classes. Maybe I'm wrong :) 12:12
kensanata: hi ^^
12:13 ryn1x joined 12:14 p6bannerbot sets mode: +v ryn1x, cognominal-p6 left 12:15 emerson joined, p6bannerbot sets mode: +v emerson
masak for the curious: www.youtube.com/watch?v=Nv8_hrS5ARY was released today, of a local talk I gave about 007 (51 min) 12:20
jkramer Are there any good modules for parsing html? modules.perl6.org/search/?q=html looks a bit sad :( 12:24
I don't want to do crazy stuff, basically just find a single specific node and get its value 12:25
masak maybe use a Perl 5 module from CPAN? 12:26
12:26 pmurias left
jkramer I wanted to avoid that :) 12:26
But I guess it's the best bet
masak pretty sure it is
12:27 pmurias joined, p6bannerbot sets mode: +v pmurias
masak I mean, I see the idealistic aspect of wanting to avoid it, but it's probably pragmatic to embrace it ;) 12:27
as TimToady would say, it was never about the "or", and always about the "and"
masak .oO( technically "xor"... )
12:28 cognominal-p6 joined
atroxaper jkramer: I have used modules.perl6.org/search/?q=xml+au...thy+Totten 12:28
12:29 p6bannerbot sets mode: +v cognominal-p6 12:30 mingdao_ is now known as mingdao
jkramer masak: The problem is I want to ship the code to people who might not be familiar with of the perls and even I am running into problems here :) dpaste.com/0PY385B 12:31
12:31 Zoffix joined, p6bannerbot sets mode: +v Zoffix
Zoffix eco: DOM::Tiny 12:31
jkramer *either of the perls
buggable Zoffix, DOM::Tiny 'Very small, self-sufficient DOM parser manipulator': modules.perl6.org/dist/DOM::Tiny:cpan:HANENKAMP
Zoffix jkramer: use that ^
jkramer Zoffix: Sweet, exactly what I was looking for :) 12:32
masak well, people seem to be suggesting p6 modules for you :)
jkramer So I don't need to use Mojo::DOM via Inline::Perl5 \o/
masak but I also think we have a big job in general of making p5<->p6 integration not just OK, but sometimes encouraged
Zoffix jkramer: FWIW, it has a huge test suite. May wish to --/test install it
(takes ages to run) 12:33
masak I haven't been around frequently enough to know whether nine++ is still fighting for the good cause, but... I happen to think it's a good idea
jkramer Thanks for the warning Zoffix :)
lizmat masak++ # nice presentation 12:34
masak <3
lizmat also: 99 ... 0 also works nicely (and optimally :-)
masak that's not Perl 6, though :P 12:35
Zoffix m: .say for 99 ... 0
camelia 99
98
97
96
95
94
93
92
91
90
89
88
87
86
85
84
83
82
81
80
79
78
77
76
75
74
73
72
71
70
69
68
67
66
65
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
4…
masak .oO( you think that's air you're breathing? ) :P
lizmat masak: ah, yes, duh :-) 12:36
masak lizmat: github.com/masak/007/blob/f2b68ee5...ottles.007
jkramer Cannot import symbol &to-json from DOM::Tiny, because it already exists in this lexical scope
Zoffix ah crap
jkramer Hmpf, the docs don't mention a &to-json in that module. How do I avoid that?
Zoffix jkramer: yeah, it's already filed as github.com/zostay/p6-DOM-Tiny/issues/12
jkramer: IIRC I just stuck DOM::Tiny into a separate file and exported just the DOM::Tiny class from it 12:37
jkramer Can I prevent it from being exported in the 'use' line?
jnthn Try `need` instead of `use`
12:38 ryn1x left
Zoffix Yeah, `need` works; jnthn++ 12:39
jkramer Yup, that works :)
Is need just use without the exports? Never seen that before
12:39 zakharyas joined
Zoffix Yeah, `use` is `need` + `import` 12:39
atroxaper I add an issue github.com/rakudo/rakudo/issues/2430. Please have a look. 12:40
jkramer It's missing in my vim p6 syntax file too :)
12:40 p6bannerbot sets mode: +v zakharyas 12:42 Zoffix left
pmurias masak: have you seen the java pattern for doing code-generation where you put annotations on a class and a preprocessor (which you write in java) takes those annotations (it also can read the signatures of method etc. of that class) and generates a class that inherits from it 12:43
masak pmurias: I had not.
pmurias the oracle people tend to use it in their truffle languages (so I have borrowed it for the nqp truffle backend) 12:46
masak ah, I see 12:47
in 007 I'd be more tempted to, you know, *transforming code* on the AST level ;)
for example, I think class declarations themselves (with or without annotations) will end up desugaring to MOP calls 12:48
12:48 kerframil joined, p6bannerbot sets mode: +v kerframil 12:49 SqrtNegI_ joined, nige_ left, haukex left, nige_ joined 12:50 p6bannerbot sets mode: +v SqrtNegI_, p6bannerbot sets mode: +v nige_
pmurias masak: some of the details of the java scheme like generating code as *strings* are a bit primitive but it's interesting what can be accomplished by little means 12:51
masak: it's also interesting how they implement regular DSLs in string annotations 12:53
@Specialization(guards = "b == 2") void doDivPowerTwo(int a, int b) { return a >> 1; } 12:54
12:55 cognominal-p6 left, cognominal-p6 joined 12:56 p6bannerbot sets mode: +v cognominal-p6 13:00 Bucciarati left, cognominal-p6 left 13:01 leedo joined, avar left 13:02 Bucciarati joined, avar joined, avar left, avar joined, p6bannerbot sets mode: +v avar, p6bannerbot sets mode: +v leedo, p6bannerbot sets mode: +v Bucciarati, p6bannerbot sets mode: +v avar
pmurias what's a SUPER equivalent in Perl 6? 13:03
$self->SUPER::method_from_parent
jkramer zostay: Should this already work in DOM::Tiny? $d.at('html > meta > link[ref=canonical]') 13:04
Seems like the attribute matching isn't working, also tried with "canonical".
13:05 molaf joined
jkramer This works just fine, so the tag is definitely there: $d.find('html > head > link').first(*.attr<rel> eq 'canonical').attr<href> 13:05
13:05 p6bannerbot sets mode: +v molaf
masak pmurias: you can probably do that exact things by walking up .^mro 13:06
pmurias: but a more idiomatic use would maybe be something like nextsame() 13:07
depends if you really want to call another method, or the same one
timotimo you can self.ClassName::methodname() 13:12
masak oh, even for class names? 13:13
timotimo as strings?
i haven't tried, actually
masak m: class C { method foo { say "C" } }; class D is C { method foo { say "D"; self.C::foo() } }; D.new.foo
camelia D
C
masak looks like
I knew it worked for roles, but not for classes
timotimo m: class Parent { method dothething() { say "parent does the thing" } }; class Child is Parent { method dothething() { say "child does the thing" }; method parentdo($classname) { self."$classname::dothething"() } }; Child.new.parentdo("Parent") 13:15
camelia Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in method parentdo at <tmp> line 1
No such method '' for invocant of type 'Child'. Did you mea…
timotimo m: class Parent { method dothething() { say "parent does the thing" } }; class Child is Parent { method dothething() { say "child does the thing" }; method parentdo($classname) { self."{$classname}::dothething"() } }; Child.new.parentdo("Parent")
camelia No such method 'Parent::dothething' for invocant of type 'Child'
in method parentdo at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo not like that in any case 13:16
13:17 kensanata left
jkramer zostay: Nevermind, I'm stupid and had a typo in the attr name :) 13:18
timotimo to be fair, you can use the right .dispatch method surely
masak: i'm watching your talk and i'm wondering, how hard would it be to port over NativeCall and CArray and friends? :) 13:28
masak timotimo: heh
timotimo: I have no idea ;)
timotimo have you done any performance comparisons between p6, nqp, and 007? 13:29
surely it's a bit better than nqp when it comes to math, because nqp still goes between int and num and back all the time
masak the short answer is "007 is ridiculously slow"
to be clear, the current 007 *interprets the AST* 13:30
timotimo oh no
oh, i hadn't realized that
masak and speed hasn't been a priority at all
timotimo that's sensible
masak because the goal is to explore macros
what I personally look forward to is to land infix:<ff> (in the short term) and `is parsed` (in the longer term) 13:32
buggable New CPAN upload: JSON-Path-1.2.tar.gz by JNTHN modules.perl6.org/dist/JSON::Path:cpan:JNTHN
13:37 mscha joined, p6bannerbot sets mode: +v mscha
mscha m: my @foo = rand xx 10; for 0,3...@foo -> $i { say $i } 13:37
camelia 0
0.8844963464615883
0.9309241180001215
0.14702861888670316
0.7359944433368208
0.6476432723661951
0.7295569500991561
0.12712475380280652
0.25546723986094133
0.945500368233164
mscha What am I doing wrong?
I expected: 0,3,6,9
m: my @foo = rand xx 10; for 0,3...@foo.elems -> $i { say $i } 13:38
camelia 0
3
6
9
timotimo the end point gets smart-matched against
i've reached the point in the presentation where you explain interpreterness and such 13:40
13:48 curan left 13:49 HaraldJoerg joined 13:50 p6bannerbot sets mode: +v HaraldJoerg 14:07 cognominal-p6 joined, cognominal-p6 left, cognominal-p6 joined 14:08 p6bannerbot sets mode: +v cognominal-p6
pmurias masak: is it planned for 007 to explore bigger (more usefull) forms of language extension then macros? 14:30
14:31 cognominal-p6 left
jkramer m: Hash.new(:lol('asd')).say 14:32
camelia {}
jkramer What's happening here?
moritz m: say Hash.new('lol', 'asd') 14:33
camelia {lol => asd}
moritz jkramer: Hash.new has a different API than you expect, that's what happens
jkramer Shouldn't it accept pairs too? According to the docs it should
moritz m: say {:lol('asd')}
camelia {lol => asd}
jkramer m: Hash.new((:lol('asd'))).say
camelia {lol => asd}
moritz jkramer: what does the tests say?
jkramer Ah it needs extra parens for some reason 14:34
moritz now you're passing the pair as a positional param
jkramer Oh that's it, thanks :)
14:34 xinming left 14:39 noganex left 14:40 noganex joined, xinming joined 14:41 p6bannerbot sets mode: +v noganex, p6bannerbot sets mode: +v xinming 14:44 lizmat left
donaldh_ There's something amiss with \ char in tr/// 14:46
m: $_ = '|\^/|'; .say; tr|^\/| |; .say 14:47
camelia |\^/|
|\ |
donaldh_ m: $_ = '|\^/|'; .say; tr|^/\| |; .say
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed replacement part; couldn't find final |
at <tmp>:1
------> 3$_ = '|\^/|'; .say; tr|^/\| |; .say7⏏5<EOL>
donaldh_ m: $_ = '|\^/|'; .say; tr|^/\\| |; .say 14:48
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed replacement part; couldn't find final |
at <tmp>:1
------> 3$_ = '|\^/|'; .say; tr|^/\\| |; .say7⏏5<EOL>
jkramer m: my %h = :foo<123>, :bar<456>, :baz<789>; class A { has $foo; has $baz; has $meep; }; A.new(:meep(123), |(%h<foo baz>:p)).say
camelia Default constructor for 'A' only takes named arguments
in block <unit> at <tmp> line 1
jkramer How can I make that work?
jnthn |% instead of | probably does it 14:49
jkramer my %h = :foo<123>, :bar<456>, :baz<789>; class A { has $foo; has $baz; has $meep; }; A.new(:meep(123), |%(%h<foo baz>:p)).say
evalable6 A.new
jkramer \o/ Thanks
14:51 cognominal-p6 joined 14:52 p6bannerbot sets mode: +v cognominal-p6 14:54 troys joined 14:55 mscha left, p6bannerbot sets mode: +v troys 14:56 cstls joined 14:57 p6bannerbot sets mode: +v cstls 14:59 fake_space_whale joined 15:00 p6bannerbot sets mode: +v fake_space_whale 15:03 aindilis left 15:04 cognominal-p6 left 15:05 cognominal-p6 joined, domidumont left, p6bannerbot sets mode: +v cognominal-p6 15:11 noganex_ joined
buggable New CPAN upload: Zodiac-Chinese-0.0.1.tar.gz by TMTVL cpan.metacpan.org/authors/id/T/TM/...0.1.tar.gz 15:12
15:12 p6bannerbot sets mode: +v noganex_ 15:15 itaipu joined, noganex left, cstls left, p6bannerbot sets mode: +v itaipu 15:21 cognominal-p6 left
Geth ecosystem: tmtvl++ created pull request #411:
Add Zodiac::Chinese (github.com/tmtvl/Zodiac-Chinese)
15:32
15:35 zakharyas left, xm-weechat joined 15:36 kerframil left, p6bannerbot sets mode: +v xm-weechat 15:38 ChoHag joined 15:39 p6bannerbot sets mode: +v ChoHag 15:40 cognominal-p6 joined 15:41 p6bannerbot sets mode: +v cognominal-p6 15:44 cognominal-p6 left, cognominal-p6 joined 15:45 p6bannerbot sets mode: +v cognominal-p6 15:48 sftp left
sena_kun m: my $m = Cursor.^methods.grep(*.name eq 'alpha')[0]; say $m.^name; say $m ~~ Method; 15:50
camelia NQPRoutine
Died with X::Multi::NoMatch
in block <unit> at <tmp> line 1
sena_kun So I see it's not a Method, but cannot match it. Any better solution comes to mind(without literal string comparsion on `^name`)? 15:52
buggable New CPAN upload: DOM-Tiny-0.5.0.tar.gz by HANENKAMP modules.perl6.org/dist/DOM::Tiny:cpan:HANENKAMP
15:53 sftp joined, p6bannerbot sets mode: +v sftp
moritz m: my $m = Cursor.^methods.grep(*.name eq 'alpha')[0]; say $m.^isa(Method) 15:53
camelia Died with X::Method::NotFound
in block <unit> at <tmp> line 1
moritz ouch
m: use nqp; my $m = Cursor.^methods.grep(*.name eq 'alpha')[0]; say nqp::istype(nqp::decont($m), Method)
15:53 holyghost left
camelia 0 15:53
15:54 holyghost joined
sena_kun hmm, I thought it's possible with nqp usage. was not sure if it's possible on user level, but, well, I guess I am deep enough anyway. 15:54
thanks, moritz!
moritz sena_kun: my pleasure
timotimo well, it's not derived from Method
15:54 p6bannerbot sets mode: +v holyghost
timotimo you'd have to check against NQPMethod, right? 15:54
moritz timotimo: but the smartmatch dieing is LTA
15:55 robertle left
sena_kun m: my $m = Cursor.^methods.grep(*.name eq 'alpha')[0]; say $m.^name; say $m ~~ NQPMethod; 15:55
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
NQPMethod used at line 1. Did you mean 'Submethod'?
sena_kun m: my $m = Cursor.^methods.grep(*.name eq 'alpha')[0]; say $m.^name; say $m ~~ NQPRoutine;
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
NQPRoutine used at line 1
15:57 xm-weechat left 16:03 fake_space_whale left
Geth ecosystem: 41d0f35cb1 | (Zoffix Znet)++ (committed using GitHub Web editor) | .travis.yml
Install SSL Sock before LWP::Simple

Looks like LWP::S's tests require it now, and that causes travis builds to croak:
  travis-ci.org/perl6/ecosystem/buil...0151#L1402
16:09
16:11 xinming is now known as xinming-irrsi
Geth ecosystem: fb972a3cde | (Tim Van den Langenbergh)++ | META.list
Add Zodiac::Chinese (github.com/tmtvl/Zodiac-Chinese)
16:18
ecosystem: 12aeecf3ef | (Tim Van den Langenbergh)++ (committed using GitHub Web editor) | META.list
Merge pull request #411 from tmtvl/master

Add Zodiac::Chinese (github.com/tmtvl/Zodiac-Chinese)
16:30 domidumont joined 16:31 p6bannerbot sets mode: +v domidumont 16:37 patrickb joined, p6bannerbot sets mode: +v patrickb 16:39 azawawi joined, p6bannerbot sets mode: +v azawawi
azawawi hi 16:39
timotimo greetings 16:40
azawawi How does one overcome CStruct pass-by-reference restriction without writing extra wrapper C code?
timotimo you mean like clone it? 16:41
azawawi is feeling puzzled
timotimo i wonder if "is copy" does anything
azawawi timotimo: im currently working on a libclang wrapper
Geth ecosystem/zoffixznet-patch-1: 460bf45c5e | (Zoffix Znet)++ (committed using GitHub Web editor) | README.install-template.md
Shorten install instructions
16:41 andrzejku left
azawawi timotimo: and was stuck for a while until i found out that restriction in docs / my own previous code :) 16:42
Geth ecosystem: zoffixznet++ created pull request #412:
Shorten install instructions
azawawi timotimo: the problem is libclang is also parsing cursors to nodes by value to callbacks... 16:43
parsing=passing
16:43 robertle joined
timotimo so the problem is that it passes structs to you, but you want to change the data locally, but not change what you got passed? 16:43
oh
it passes structs without a pointer
i think only returning structs is problematic 16:44
16:44 p6bannerbot sets mode: +v robertle
azawawi timotimo: true... CStruct objects are passed to native functions by reference and native functions must also return CStruct objects by reference 16:46
anyways without wrapping CXCursor passing-by-value, I get silent & random segmentation faults. 16:47
github.com/azawawi/scripts/blob/ma...ibclang.p6 # so far
once libclang is wrapped, we can traverse the nodes... and basically output nativecall stuff... like bindgen in rust. 16:48
parse C/C++ headers easily... automate nativecall boilerplate and provide another way besides gptrixie 16:50
stuck now in the final node traversal (callbacks) 16:52
16:54 AlexDaniel left, domidumont left
Geth ecosystem: 4aca12bf96 | (Zoffix Znet)++ (committed using GitHub Web editor) | .travis.yml
s/zen/zef/;
17:02
17:05 jmerelo joined 17:06 p6bannerbot sets mode: +v jmerelo 17:07 xinming joined 17:08 p6bannerbot sets mode: +v xinming, marmay left
Geth ecosystem/zoffixznet-patch-1: 4aca12bf96 | (Zoffix Znet)++ (committed using GitHub Web editor) | .travis.yml
s/zen/zef/;
17:11
ecosystem/zoffixznet-patch-1: 2f7529dc12 | (Zoffix Znet)++ | .travis.yml
Merge branch 'master' into zoffixznet-patch-1
17:23 xinming left
Geth ecosystem: fb35f0c271 | (Zoffix Znet)++ (committed using GitHub Web editor) | README.install-template.md
Shorten install instructions (#412)
17:25
17:28 xinming joined 17:29 p6bannerbot sets mode: +v xinming 17:36 azawawi left 17:53 jmerelo left 17:57 azawawi joined, p6bannerbot sets mode: +v azawawi
azawawi timotimo: ping :) 17:57
github.com/azawawi/scripts/blob/ma...ibclang.p6 # First libclang AST traversal example is now working... Needed to wrap CStruct 17:59
two weaknesses of NativeCall so far... CStruct passing and inability to create static native arrays in a simple way 18:02
gist.github.com/azawawi/bd30168698...e6b798a29c # example output 18:03
18:08 itaipu left 18:18 azawawi left 18:22 aindilis joined 18:23 p6bannerbot sets mode: +v aindilis 18:28 kst joined 18:29 p6bannerbot sets mode: +v kst 18:34 AlexDaniel joined, p6bannerbot sets mode: +v AlexDaniel 18:46 alcymd joined 18:47 p6bannerbot sets mode: +v alcymd
Geth doc: 4b15d44eee | Coke++ | doc/Language/subscripts.pod6
make example compile
18:57
synopsebot Link: doc.perl6.org/language/subscripts
18:58 xinming left, xinming joined 18:59 p6bannerbot sets mode: +v xinming 19:01 pmurias left 19:05 pmurias joined, p6bannerbot sets mode: +v pmurias
buggable New CPAN upload: Libclang-0.0.1.tar.gz by AZAWAWI cpan.metacpan.org/authors/id/A/AZ/...0.1.tar.gz 19:12
19:16 lizmat joined, p6bannerbot sets mode: +v lizmat 19:32 atroxaper left 19:37 alcymd left 19:38 harrison joined 19:39 p6bannerbot sets mode: +v harrison
harrison m: class Foo { has Str $.a; }; my $f = Foo.new(a => 'aaaah'); say $f; 19:40
camelia Foo.new(a => "aaaah")
AlexDaniel .
yoleaux 16:35Z <Zoffix> AlexDaniel: just wanted to confirm before I do it: am I safe to bump default lang version in Rakudo to 6.d or should I wait until after release?
AlexDaniel El_Che: if you're interested, last blocker was resolved 19:41
El_Che AlexDaniel: I am, thank you
AlexDaniel El_Che: so we're not far away from the release, but it may take a bit still
El_Che AlexDaniel: great! 19:42
I added a /etc/profile.d/rakudo-pkg.sh to set the profile, because many Linux newbies don't know how to set the PATH (and don't read the readme :) ) 19:43
I also added a link from the bin of perl6 to rakudo
harrison m: class Foo { has Str $.@a; } my $f = Foo.new(a => <1 2 3 4>); say $f; 19:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of $. variable; in Perl 6 please use the .kv method on e.g. .lines
at <tmp>:1
------> 3class Foo { has Str $.7⏏5@a; } my $f = Foo.new(a => <1 2 3 4>); s
harrison m: class Foo { has Str @.a; } my $f = Foo.new(a => <1 2 3 4>); say $f;
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3class Foo { has Str @.a; }7⏏5 my $f = Foo.new(a => <1 2 3 4>); say $f
expecting any of:
infix
harrison m: class Foo { has Str @.a; }; my $f = Foo.new(a => <1 2 3 4>); say $f; 19:47
camelia Foo.new(a => Array[Str].new(IntStr.new(1, "1"), IntStr.new(2, "2"), IntStr.new(3, "3"), IntStr.new(4, "4")))
harrison m: class Foo { has Str @.a; }; my $f = Foo.new(a => ('awesome')); say $f;
camelia Foo.new(a => Array[Str].new("awesome"))
19:48 xinming left
tobs m: class Foo { has Str @.a; }; my $f = Foo.new(a => 'even without parens'); say $f; 19:48
camelia Foo.new(a => Array[Str].new("even without parens"))
harrison m: my @letters = 'a'...'d'; class Foo { has Str @.a; }; my $f = Foo.new(a => @letters); say $f; 19:49
camelia Foo.new(a => Array[Str].new("a", "b", "c", "d"))
harrison Does the existence of precompilation mean that I can dare dream of Perl6 being compiled to bytecode in the future? 19:52
timotimo it is already compiled to bytecode 19:57
try moar --dump Something.moarvm
the CORE.setting.moarvm is a bit gigantic
but you'll find enough smaller things :)
harrison timotimo: Interesting... so like the way one ships Java code... the same will be possible for Perl 6 in the future? 19:58
afaik it is not possible now. 19:59
geekosaur portable precomps are a problem currently, yes
harrison So I am getting a strange error on This is Rakudo version 2018.09 built on MoarVM version 2018.09... pastebin.com/MZ22RsLs 20:01
geekosaur you're nesting ''s 20:02
so your "string" 'aaaah' is not quoted
use double quotes or q{} or something 20:03
AlexDaniel syntax highlighting is very helpful there
20:04 xinming-irrsi left
geekosaur not so helpful here since it's the shell that is doing it and the shell doesn't typically do syntax highlighting 20:04
harrison geekosaur, oh, thanks. *face palm.
AlexDaniel geekosaur: yeah but on that paste it's accidentally very right 20:05
20:06 xinming joined 20:07 p6bannerbot sets mode: +v xinming
harrison So uh, either I need to get some sleep or I am overlooking something very obvious. So this is the new error: pastebin.com/kS1fQgBA 20:07
m: class Foo { has Str $.a; }; my $f = Foo.new(a => 'aaaah'); say $f; 20:08
camelia Foo.new(a => "aaaah")
harrison Huh? It works here.
*confused
timotimo i see your problem
you are using ""
look at the code that perl6 is echoing back at you
it sees "my = Foo.new" 20:09
that's because your shell doesn't have a $f defined, so it replaces it with the empty string
harrison timotimo, oh yes. You are right.
20:09 xinming left
timotimo shells are fun, aren't they :) 20:10
20:10 xinming joined 20:11 p6bannerbot sets mode: +v xinming
harrison timotimo lol. I saw a quote on twitter, attributed to Larry Wall, 'It is easier to port a shell than to port a shell script.' 20:11
timotimo that has a truthish feel to it 20:12
geekosaur go look at the configure scripts autoconf creates sometime. if you dare. 20:13
harrison twitter.com/CodeWisdom/status/7315...4692992000
20:13 cognominal-p6 left, cognominal-p6 joined 20:14 p6bannerbot sets mode: +v cognominal-p6 20:30 xinming is now known as xinming-weechat, harrison left
masak pmurias: re "bigger forms of language extensions than macros" -- yes, there's a (hazy) vision of being able to build slangs 20:38
in 007 terminology, a "lang" is a thing that drives a parser at the top level of a program, and a "slang" is generally a nested language, often with a quasiquote-like exchange of values with its outside 20:46
20:47 cognominal-p6 left, cognominal-p6 joined 20:48 p6bannerbot sets mode: +v cognominal-p6 20:51 xinming-weechat is now known as xinming 21:02 rindolf left, rindolf joined 21:03 p6bannerbot sets mode: +v rindolf
moony Perl 6 needs a good way to parse binary data, not just strings. Converting a string to it's binary form to parse it via grammar/regex feels evil. 21:08
also, attempting to assign a <( )> capture to a capture variable results in brokenness (Did it by mistake). 21:10
timotimo yeah, that's true. though i don't know what you mean by "<( )> capture" 21:11
moony i.e. $<sillyvariable>=<(.)> 21:12
21:13 pmurias left
timotimo <( is actually a thing in and of itself, and so is )> 21:13
moony oh ok
21:13 comborico1611 joined
timotimo i tend to think of them as "inside-out lookbehind and lookahead" 21:13
but effectively they just set the beginning and end of the match to where ever they happen to have matched 21:14
21:14 p6bannerbot sets mode: +v comborico1611
timotimo m: say "hello world" ~~ / <( . l l . )> . <alpha> /; 21:14
camelia Potential difficulties:
Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)
at <tmp>:1
------> 3say "hello world" ~~ / <( . l7…
timotimo m: say "hello world" ~~ / <( . ll . )> . <alpha> /;
camelia 「ello」
alpha => 「w」
timotimo look, you can ever have a match that sits outside of the matched text of the whole match 21:15
even*
21:15 pmurias joined, p6bannerbot sets mode: +v pmurias 21:19 MasterDuke joined, p6bannerbot sets mode: +v MasterDuke, MasterDuke left, MasterDuke joined, herbert.freenode.net sets mode: +v MasterDuke, p6bannerbot sets mode: +v MasterDuke
MasterDuke moony: jnthn has a proposal somewhere on improving binary parsing in perl 6 21:22
timotimo are you refering to the recent one for getting data from blobs? like "read a 32bit integer" and stuff? 21:23
MasterDuke timotimo: i think so 21:34
timotimo i think they're hoping for something more like grammars, but for bytes 21:35
MasterDuke ah
timotimo or even pack/unpack 21:36
avuserow I worked on a p6 module inspired by Python's Construct module as Binary::Structured
it's a class-based approach for representing binary data 21:37
MasterDuke eco: Binary::Structured 21:39
buggable MasterDuke, Binary::Structured 'Read and write binary formats defined by classes': modules.perl6.org/dist/Binary::Stru...n%20Kreher
21:40 HaraldJoerg left 21:52 pmurias left
moony timotimo, i'm talking about grammars for individual bits haha 21:56
for reading highly packed data
22:00 patrickb left 22:05 ufobat left, rindolf left 22:08 rindolf joined, p6bannerbot sets mode: +v rindolf 22:19 rindolf left 22:20 cognominal-p6 left 22:29 sena_kun left 22:44 wintertot joined 22:45 p6bannerbot sets mode: +v wintertot 22:46 Zoffix joined, p6bannerbot sets mode: +v Zoffix 22:47 Zoffix left 22:50 d3b left 22:53 pecastro left 23:02 sno left 23:04 sno joined 23:05 p6bannerbot sets mode: +v sno 23:15 Elronnd left 23:41 wintertot left