»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
SmokeMachine any way to simulate the COMPOSE phaser? (it's NIY, right?) 00:00
SmokeMachine timotimo: I have to call MyClass.COMPOSE, but its working... www.irccloud.com/pastebin/2Obs54h6/ 00:01
SmokeMachine is there any plan to support the COMPOSE phaser? 00:16
regreg hello 00:17
is there any good perl6 gui for windows?
or sdl 00:18
SmokeMachine m: 42 but role {method ^compose {say "!!!"}} # should this work? 00:30
camelia rakudo-moar 5b3ac8: OUTPUT«Potential difficulties:␤ Useless declaration of a has-scoped method in multi (did you mean 'my method compose'?)␤ at <tmp>:1␤ ------> 0342 but role {method7⏏5 ^compose {say "!!!"}} # should this wor␤»
brokenchicken buggable: eco 00:38
buggable brokenchicken, Out of 775 Ecosystem dists, 119 have warnings and 4 have errors. See modules.perl6.org/update.log for details
brokenchicken buggable: eco sdl
buggable brokenchicken, Found 2 results: SDL, SDL2::Raw. See modules.perl6.org/#q=sdl
brokenchicken regreg: we have SDL2::Raw ^
brokenchicken SmokeMachine: what would that even do? 00:40
SmokeMachine brokenchicken: wrap some methods when my role is composed on a class... 00:41
ugexe if you are keeping it simple you can sort of mimick compose by just putting the code in the body of the role
SmokeMachine www.irccloud.com/pastebin/2Obs54h6/ 00:41
ugexe m: (42 but role :: {say "Composed"}) 00:42
camelia rakudo-moar 5b3ac8: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 42 in sink context (line 1)␤Composed␤»
SmokeMachine m: my $a = 42 but role :: {say "the composed class: {self.WHAT}"} 00:43
camelia rakudo-moar 5b3ac8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤'self' used where no object is available␤at <tmp>:1␤------> 3 but role :: {say "the composed class: {7⏏5self.WHAT}"}␤ expecting any of:␤ term␤»
SmokeMachine m: my $a = 42 but role :: {say "the composed class: {::?CLASS}"}
camelia rakudo-moar 5b3ac8: OUTPUT«Use of uninitialized value of type Int+{<anon|58096592>} in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤ in sub at <tmp> line 1␤the composed class: ␤»
ugexe its a role not a class
you're pretty much instantly jumping past the "if you are keeping it simple" bit :/
m: say (42 but role :: {.^add_method("foo", method () returns Str {say "!!!"})}).foo 00:44
camelia rakudo-moar 5b3ac8: OUTPUT«!!!␤Type check failed for return value; expected Str but got Bool (Bool::True)␤ in method <anon> at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
ugexe m: (42 but role :: {say $?ROLE}) 00:44
camelia rakudo-moar 5b3ac8: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 42 in sink context (line 1)␤(<anon|48003744>)␤»
SmokeMachine ugexe: but its being composed in a class... and I want to wrap that class' methods... 00:45
brokenchicken ::?CLASS will be the class the role's composed into
ugexe m: (42 but role :: {say $?CLASS}) 00:47
camelia rakudo-moar 5b3ac8: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 42 in sink context (line 1)␤(Int+{<anon|57211552>})␤»
SmokeMachine m: my $a = 42 but role :: {method role-method {}; ::?CLASS.role-method} 00:49
camelia rakudo-moar 5b3ac8: OUTPUT«Could not instantiate role '<anon|56450064>':␤No such method 'role-method' for invocant of type 'Int+{<anon|56450064>}'␤ in any protect at gen/moar/stage2/NQPCORE.setting line 802␤ in block <unit> at <tmp> line 1␤␤»
SmokeMachine m: my $a = 42 but role :: {method role-method {}; :(.role-method}
camelia rakudo-moar 5b3ac8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in parenthesized expression; couldn't find final ')' ␤at <tmp>:1␤------> 3: {method role-method {}; :(.role-method7⏏5}␤ expecting any of:␤ statement end␤ …»
SmokeMachine :(
sammers hi #perl6 00:58
brokenchicken \o 00:59
SmokeMachine I think that when that code runs, my class' methods do not exist yet... 01:00
m: role R {::?CLASS.^methods.say}; class C does R {method my-method {}}
camelia rakudo-moar 5b3ac8: OUTPUT«(my-method)␤»
SmokeMachine m: role R {::?CLASS.^find_method("my-method").say}; class C does R {method my-method {}} 01:01
camelia rakudo-moar 5b3ac8: OUTPUT«my-method␤»
SmokeMachine ?
brokenchicken What?
SmokeMachine m: role R {::?CLASS.^attributes.say}; class C does R {has $.bla} 01:02
camelia rakudo-moar 5b3ac8: OUTPUT«(Mu $!bla)␤»
SmokeMachine I wasnt expecting that...
m: role R {::?CLASS.^methods.say}; class C does R {has $.bla} 01:05
camelia rakudo-moar 5b3ac8: OUTPUT«()␤»
SmokeMachine that is it!!! the methods weren't created yet!
m: role R {::?CLASS.^methods.say}; class C does R {has $.auto-created; method hardcoded {}} 01:07
camelia rakudo-moar 5b3ac8: OUTPUT«(hardcoded)␤»
SmokeMachine why the hardcoded was created but the auto-created wasn't? 01:08
timotimo because auto-created probably ran at the end of composition 01:16
whereas the body fo the class and its roles and such runs near the beginning of composition?
oh, you were talking about accessor methods for attributes
SmokeMachine timotimo: yes, I was... 01:18
timotimo too distracted to be of any help :o 01:19
SmokeMachine timotimo: with a method COMPOSE its working...
timotimo nice
SmokeMachine but Id like to do not need to call that method 01:20
sammers is there a list of ords that make up \h? 01:50
brokenchicken m: (^0x110000).grep(*.chr.match: /\h/).say 01:56
camelia rakudo-moar 5b3ac8: OUTPUT«(9 32 160 5760 6158 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8239 8287 12288)␤»
brokenchicken m: (^0x110000).grep(*.chr.match: /\h/)».&{"U+" ~ .base(16)}.say 01:57
camelia rakudo-moar 5b3ac8: OUTPUT«(U+9 U+20 U+A0 U+1680 U+180E U+2000 U+2001 U+2002 U+2003 U+2004 U+2005 U+2006 U+2007 U+2008 U+2009 U+200A U+202F U+205F U+3000)␤»
sammers brokenchicken: thanks 02:05
sammers is there any way to improve perfomance when calling a local lib (use lib 'lib')? 02:11
Geth oc: CurtTilmes++ created pull request #1169:
Better word choice
02:22
brokenchicken sammers: yes, don't call it from a place that has a ton of files as it reads and concats ALL of them 02:24
(including subdirectories) 02:25
Geth oc: b6916b6e81 | (Curt Tilmes)++ | doc/Language/containers.pod6
Better word choice
oc: 140460d133 | (Zoffix Znet)++ | doc/Language/containers.pod6
Merge pull request #1169 from CurtTilmes/master

Better word choice
sammers brokenchicken: ah, that is useful to know. that would explain my current scenario 02:26
brokenchicken Oh, I think I'm wrong about the "all" part. It's just the ones that have .pm/.pm6 extension 02:27
brokenchicken aye: github.com/rakudo/rakudo/blob/nom/...pm#L64-L67 02:28
sammers when I install a package via zef it always feels snappier than when I run using lib 'lib' 02:31
brokenchicken Yeah, this is one of the reasons. It doesn't need to slurp all the files for installed modules, only for the FileSystem repository 02:33
And it'd recompile the precomp files any time there's a change in any of those slurped files 02:34
hmm 02:35
Or something or other; I'm not familiar with the process :)
sammers hmm, I would like to capture execution time after the recompile, is there any way to detect post-compilation? 02:37
ugexe if you -Ilib it gets put at the front of the dependency chain. when you `use lib "lib"` it gets put somewhere else 02:38
sammers ah
ugexe that + possibly affecting what can be precompiled would give that type of difference 02:39
sammers ugexe, just tested it. seems to make a noticable difference with what I am working on. thanks. the times are closer to what I was seeing using the pre-compiled modules. 02:40
MasterDuke .tell agentzh what ugexe just mentioned here ^^^ about -Ilib being faster than `use lib "lib"` may be of interest to you 02:43
yoleaux MasterDuke: I'll pass your message to agentzh.
brokenchicken wow. My Twitter feed is nothing but trump and pics+videos of protests. 02:44
brokenchicken does a mental account of all of the dealings with US businesses should those have to be transfered elsewhere... 02:45
agentzh MasterDuke: I'm not using `use lib 'lib'`. i've been using -Ilib already :) 02:50
yoleaux 02:43Z <MasterDuke> agentzh: what ugexe just mentioned here ^^^ about -Ilib being faster than `use lib "lib"` may be of interest to you
agentzh brokenchicken: heh. 02:51
MasterDuke oh well, then no easy win there
agentzh MasterDuke: i'm already using a merge script that merge everything into a giant .p6 file. 02:52
MasterDuke: removing all those use statements.
MasterDuke: it's the fastest setting right now.
but still not fast enough. about 6.8 ~ 7 sec compilation time 02:53
better than 13 sec though :)
MasterDuke i've been watching Jonathan Blow's videos about his new language Jai. very envious of 0.3s compile times for a 30k line program 02:55
agentzh that's fast.
MasterDuke that's for generating unoptimized code, but it's still great for workflow speed 02:57
agentzh right
sammers I am not sure if there is a name for this, but is there currently an iterator limit? like, the time to iterate to the next value, not counting the execution time of whatever my code does with the iterator? 02:58
m: my $now = now; (1..5).map: { "{$now - now}".say } 03:00
camelia rakudo-moar 5b3ac8: OUTPUT«-0.0014551␤-0.00464284␤-0.005704␤-0.0065557␤-0.0075582␤»
sammers m: my $now = now; (1..5).map: { "{$now - now}".say; $now = now; }
camelia rakudo-moar 5b3ac8: OUTPUT«-0.00144098␤-0.000199␤-0.000226␤-0.0002521␤-0.0003689␤»
samcv making this change I get an error: Cannot modify an immutable Int 04:00
in sub apply-to-cp at ./UCD-gen.p6 line 501
MasterDuke you tried to assign to/modify an ro function parameter? 04:03
samcv i don't think so 04:04
i mean i run .split, and then run parse-base on it
but the error is on link 501, where all I do is create a Range object
samcv oh dumb 04:07
i did = instead of == XD
shows how tired i am right now
seekitoutx Everytime I attempt to 'rakudobrew build moar' I get this error: gist.github.com/anonymous/a0a287c6...f42dfa44d2 04:43
Anyone know how to fix this?
running debian 3.16.36-1+deb8u2
brokenchicken seekitoutx: that looks like you've not enough RAM to compile it 04:48
seekitoutx: why are you using rakudobrew?
huggable: deb
huggable brokenchicken, CentOS and Debian Rakudo packages: github.com/nxadm/rakudo-pkg/releases
brokenchicken You need about 1.5GB of RAM (or swap) to compile it from scratch. 04:50
seekitoutx Where do I get panda from? 04:52
brokenchicken You don't. It's not a recommended package manager 04:53
buggable: eco zef
buggable brokenchicken, zef 'It's like [cpanm] wearing high heels with a tracksuit': github.com/ugexe/zef
brokenchicken seekitoutx: ^ use that. The README should have bootstrapping instructions
seekitoutx I see
thanks guys
brokenchicken Just made a compilation run: it needed 1.239168GB of RAM 04:54
seekitoutx only have 1gb on this lol
brokenchicken I compiled on 1GB VM before and I had a few gigs of swap to help it out 04:55
samcv i forget who it was that said to do %hash.keys.sort(+*) instead of %hash.keys.sort({$^a.Int cmp $^b.Int}) 05:18
it turns out %hash.keys.sort(*.Int) is faster than (+*)
though the $^a etc thing is the slowest of the three
brokenchicken It was thundergnat. 05:29
And yeah, the +* form likely goes to .Numeric -> .Bridge or some or other 05:30
s: &prefix:<+>, \('42')
SourceBaby brokenchicken, Sauce is at github.com/rakudo/rakudo/blob/5b3a...ric.pm#L43
brokenchicken s: '42', 'Numeric', \()
SourceBaby brokenchicken, Sauce is at github.com/rakudo/rakudo/blob/5b3a...tr.pm#L303
brokenchicken Ah right, now I remember 05:31
brokenchicken And .Int has a fastpath, while .Numeric goes through val() 05:31
BenGoldberg m: say val('1.2') 05:44
camelia rakudo-moar 5b3ac8: OUTPUT«1.2␤»
BenGoldberg m: dd val('1.2')
camelia rakudo-moar 5b3ac8: OUTPUT«RatStr.new(1.2, "1.2")␤»
BenGoldberg m: dd val('1e2')
camelia rakudo-moar 5b3ac8: OUTPUT«NumStr.new(100e0, "1e2")␤»
BenGoldberg m: dd val('12')
camelia rakudo-moar 5b3ac8: OUTPUT«IntStr.new(12, "12")␤»
BenGoldberg m: dd val('') 05:45
camelia rakudo-moar 5b3ac8: OUTPUT«IntStr.new(0, "")␤»
BenGoldberg s: &val, \('42')
SourceBaby BenGoldberg, Sauce is at github.com/rakudo/rakudo/blob/5b3a...hs.pm#L131
masak morning, #pwel6 07:58
er, #perl6
masak adjusts his posture a little bit at the keyboard 07:58
masak I just discovered a nice pattern for people who, like me, still use `say` for debugging purposes sometimes 07:59
the pattern is `if $some-condition ff False { say ... }`
gets rid of a lot of debug print noise before $some-condition
moritz huh? 08:05
what does ff False do?
masak goes on being true forever 08:07
IOW, it never flops
but the other important detail is that it flips when I want it to, and so it's quiet before that
remind me, is .WHICH the one that promises to never change regardless of GC moves? 08:08
because .WHERE sure doesn't seem to be it ;)
lizmat masak: .WHICH is it, afaik 08:16
arnsholt masak: That's a neat trick! 08:23
For some reason, kind of reminds me of Smalltalk's version of conditional breakpoints: "aCondition ifTrue: [ self halt ]." 08:24
Just inserted into the code wherever you need to break
masak arnsholt: cute! 08:34
lizmat: yes, also found that out independently; thanks :)
gfldex can a routine get hold of it's complete argument list at runtime? 08:50
moritz if it captures it, yes 08:55
moritz m: sub f(|c) { say "called with c.perl()" }; f 'x', a => 'b' 08:55
camelia rakudo-moar 5b3ac8: OUTPUT«called with c.perl()␤»
moritz m: sub f(|c) { say "called with ~", c.perl() }; f 'x', a => 'b'
camelia rakudo-moar 5b3ac8: OUTPUT«called with ~\("x", :a("b"))␤»
arnsholt masak: Yeah, it's pretty neat 09:01
It feels kind of horrid to manipulate the code directly when you want to do this kind of thing, but once you get used to the idea of code and app and IDE being an integrated whole, it makes sense to do it that way 09:02
gfldex moritz: i need it for subs that don't capture. Would be nice for debug output to have all input values next to a stacktrace. A bit tricky for `is rw` parameters ofc. I can .wrap to get that but then I have to do it before the Routine is called. 09:04
and it must be there because callsame actually works 09:05
DrForr gfldex: I did something like that with an attribute and capturing at compile time.
moritz gfldex: stackoverflow.com/questions/4129061...e/41292805 might interest you 09:06
moritz there might also be some NQP magic to get to the current argument capture 09:06
moritz nqp::p6argvmarray or so 09:07
gfldex i forgot about `is default` 09:08
and I even know why. It's not in the index in the docs. :) 09:09
Pro Tip: if you want to learn a new language, write it's official documentation. 09:10
moritz +1 :-) 09:14
Geth oc: fd2e714e9a | (Wenzel P. P. Peppmeyer)++ | 2 files
move is default to routine and get it into the index
09:22
Geth oc: 9e8e6fbb37 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Variable.pod6
index is default (Variable)
09:33
oc: e8d6d8de9b | (Wenzel P. P. Peppmeyer)++ | doc/Type/Attribute.pod6
doc `is default` on Attribute
as__ rakudo: my %h = (a => 1, b => 2); say %h<a b>; my $k = 'a b'; say %h<$k> 09:34
camelia rakudo-moar 5b3ac8: OUTPUT«(1 2)␤(Any)␤»
as__ Hi guys. Is it ^^ a bug in Rakudo?
moritz as__: no 09:35
you're trying to access the hash key '$k'
which doesn't exist 09:36
arnsholt (Nor does the key 'a b', we might add) 09:36
moritz m: my %h = (a => 1, b => 2); say %h<a b>; my $k = 'a b'; say %h<<$k>>
camelia rakudo-moar 5b3ac8: OUTPUT«(1 2)␤(1 2)␤»
moritz but we've got your bases covered! ^^
as__ I am looking at docs.perl6.org/language/5to6-nutsh...%2Fslicing 09:37
rakudo: my %h = (a => 1, b => 2, 'a b' => 3); say %h<a b>; my $k = 'a b'; say %h<$k>
camelia rakudo-moar 5b3ac8: OUTPUT«(1 2)␤(Any)␤»
as__ you see, it does not work either
moritz as__: do you see the docs using $k inside of a <> subscript anywhere? 09:38
moritz I see say %calories«$key»; # Perl 6 - double angles interpolate as a list of Str 09:38
and «...» is the same as <<...>>, which I've shown above
as__: if you have ideas on how to make the docs clearer, please submit a pull request
as__ ah so
thanks 09:39
Geth oc: 2c78f633c9 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Attribute.pod6
doc `is required` on Attribute
09:40
gfldex m: class C { has $.a is DEPRECATED }; my $c = C.new(a=>42); say $c.a; CATCH{ default { say .^name, ': ', .Str } } 09:51
camelia rakudo-moar 5b3ac8: OUTPUT«42␤»
gfldex tricky, it's in roast but NYI for Rakudo. Do I doc that or not? 09:52
Geth oc: 7f2f50a1d2 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Attribute.pod6
doc `is DEPRECATED` on Attribute
09:55
gregf_ *feels he needs a Perl6 refresh every monday morning!" 10:15
gregf_ s/"$/\*/ 10:17
Geth oc: c0353c2305 | (Wenzel P. P. Peppmeyer)++ | doc/Language/subscripts.pod6
add Callable to the table
travis-ci Doc build errored. Wenzel P. P. Peppmeyer 'add Callable to the table' 11:10
travis-ci.org/perl6/doc/builds/196532916 github.com/perl6/doc/compare/7f2f5...353c23054a
timotimo huh, were int and long merged in python3? 12:05
arnsholt timotimo: Looks like it. The standard library gives the type int, float and complex in the category numeric types 12:07
timotimo OK
that's good to know
arnsholt "Integers have unlimited precision."
So int, long and bigint have been merged in fact 12:08
timotimo there used to be bigint? 12:13
why? 12:14
long was already infinite precision
arnsholt Oh derp 12:20
arnsholt For some reason I had long as C long 12:20
timotimo :)
m: use NativeCall; my long $foo = 9999999999999; say $foo
camelia rakudo-moar 5b3ac8: OUTPUT«9999999999999␤»
timotimo m: use NativeCall; my long $foo = 99999999999999999999999999999; say $foo
camelia rakudo-moar 5b3ac8: OUTPUT«Cannot unbox 97 bit wide bigint into native integer␤ in block <unit> at <tmp> line 1␤␤»
garu hi everyone! quick question: how would one apply a role dynamically to an object? e.g. submethod BUILD { my $role = q|Some::Role|; self does $role } 12:24
timotimo you want ::('Some::Role') 12:25
garu I tried it... but maybe I'm doing something wrong, let me check real quick 12:25
ah, the variable must be defined, of course :) 12:26
timotimo good idea
garu timotimo: thanks! I was testing it with my $x; $x does ::($class) and was getting an error 12:27
timotimo ah
garu but my $x = 10 made it work :)
garu timotimo: import ::($role) before the 'does' is also a big deal :) 12:29
garu still learning the ropes 12:30
timotimo yeah, if it's not in scope, or you didn't import the right module for it, perl6 isn't going to rummage through your hard drive for .pm6 files that contain a role of that name :) 12:31
masak TimToady: S04 says a BEGIN block "only ever runs once". given that a BEGIN block's ASAP is not until macro expansion time if the BEGIN block contains unquotes that need to be populated -- would you expect such a BEGIN block to run only at the first macro expansion, or at each one? 12:35
timotimo hm. is there a way to mean the other when that decision is made? 12:36
i expect you can put a BEGIN block into a macro (but outside of any quasiquote) and use the result of that inside an unquote inside a quasiquote 12:37
masak it's easier to emulate really-only-once with the actually-once-per-expansion semantics than the reverse.
masak I'm not sure that's enough to choose between the two, though. 12:38
masak timotimo: yes, BEGIN blocks in macros (but outside quasis) are entirely unproblematic. 12:38
by the way, I love how these questions are driven by actual implementation nowadays. 12:39
arnsholt But wouldn't a BEGIN inside a quasi give rise to a new BEGIN for each instantiation of the macro anyways? 12:44
masak that's my question, essentially. 12:45
timotimo yeah
so if you spell out BEGIN in the code, its behaviour depends on whether it's inside an unquote or not
masak whether it counts as "the same" BEGIN block (and so it fires only the once)
or "a fresh" BEGIN block each time (and so it fires per expansion) 12:46
as scientists, we just don't know, because we haven't really cloned unfired BEGIN blocks before in human history
timotimo i consider us extremely lucky in this respect 12:47
we don't have to fire our experiment up into microgravity to test stuff out
masak what a time to be alive 12:48
I think my gut feeling is to lean towards arnsholt's reaction, too 12:49
timotimo mine, too
masak maybe partly because it feels like if someone put an unquote into a BEGIN, they definitely meant for it to fire at expansion -- and so probably at each expansion 12:50
arnsholt And even without the unquote, no?
masak no, I expect BEGIN blocks to fire ASAP
so if it can -- that is, if unhindered by unquote -- it fires
arnsholt If you have, with a Lisp, "(defmacro marco () '(BEGIN ...))" the BEGIN belongs in the context of the expansion, not the call, no? 12:51
masak I can see an argument for that being made, sure
but that does not seem to be the Perl Way 12:52
BEGIN fires ASAP, not later than that
and the fact remains that sans unquotes, the BEGIN block *is* ready to fire immediately -- and that's the overriding rule
I remember having a wonderful conversation about this with TimToady 12:53
where I pointed out that BEGIN and END were not fully symmetric to each other
(since BEGIN does not fire at the literal beginning of the program; it fires once the parser has consumed it) 12:54
and I asked him how he as a language designer could motivate that
his one-word response (which he then expanded on) was "gravity" :)
El_Che ah damn
masak i.e. BEGIN slides as far up as it can in the program, and END slides as far down as it can 12:55
El_Che he should have used lain
latin
gravitas
masak El_Che: you're free to pretend he did say it like that :P
El_Che for his biography 12:56
masak pictures a thick book with the title "Gravitas", with TimToady sporting his usual Texas hat and colorful shirt 12:57
El_Che ahaha 12:58
SmokeMachine hi! is there any chance to make the body of a role be executed after all the (accessor) methods are created?
ilmari is reminded of the Culture ship "Gravitas" running gag 12:59
SmokeMachine m: role R {say ::?CLASS.^find_method("bla")}; class C does R {has $.bla}
camelia rakudo-moar 5b3ac8: OUTPUT«(Mu)␤»
masak SmokeMachine: you're probably looking for the COMPOSE phaser
SmokeMachine masak: yes, I am...
masak ilmari: that must've been somewhere at the back of my mind, too 13:00
SmokeMachine m: role R {COMPOSE {say ::?CLASS.^find_method("bla")}}; class C does R {has $.bla}
camelia ( no output )
SmokeMachine masak: but ^^ 13:00
ilmari masak: I only just discovered the background for it: search for gravitas on www.theguardian.com/books/2000/sep...ce-fiction
or en.wikipedia.org/wiki/List_of_spac...ther_ships 13:01
timotimo m: role R { say "begin role R"; COMPOSE { say "compose role R" }; say "end role R"; }; class C does R { say "begin class C"; has $.bla; COMPOSE { say "compose class C" }; say "end class C" }
camelia rakudo-moar 5b3ac8: OUTPUT«begin role R␤end role R␤begin class C␤end class C␤»
ilmari masak: but that sound exactly like something the culture and its ships would do
timotimo ah, COMPOSE is NYI?
perhaps it should complain loudly, then.
SmokeMachine timotimo: I'd rather to be implemented... :P 13:02
timotimo of course
masak ilmari: yes, I saw that interview a while ago, I think 13:06
SmokeMachine whats needed to implement the COMPOSE phaser? 13:11
when it should run?
Id like to try to implement it... 13:13
arnsholt At a guess, I think you'd have to add a compose phaser callback to the Role HOW object, which can be called at composition 13:15
I'm a bit foggy on exactly how you'd go about implementing that though
But some of the other phasers might be instructive
SmokeMachine arnsholt: thanks! Ill try to read those... 13:16
jnthn I think "what is it meant to do" is the main blocker here :) 13:17
arnsholt That'd be a bigger blocker, yes =) 13:18
Intuitively, it's "whenever the role is composed into a class", but I'm guessing that's not an unambiguous formulation?
SmokeMachine jnthn: so, is it not implemented yet because it's not agreed to how it should work? 13:24
masak .oO( does the use case at hand provide any clues as to how it should work? ) :P 13:25
jnthn arnsholt: Something like that...also what's in scope, what scopes can it be placed into, etc.
faraco looking at sixth-sense. 13:26
jnthn Thing is, if you want code to be run at the point a role is being composed into a class, you can just write code into the role body 13:27
jnthn m: role R { say "being composed into $?CLASS.^name()" }; class C1 does R { }; class C2 does R { } 13:27
camelia rakudo-moar 87d40a: OUTPUT«being composed into C1␤being composed into C2␤»
arnsholt Ah, right. In that case there's less call for it, I agree 13:28
jnthn Since role bodies are evaluated at the point of composition.
And in a class you can write a BEGIN block before, or after, the closing curly
arnsholt SmokeMachine: See above 13:29
arnsholt It's a bit odd that the find_method doesn't work though; maybe auto-generated methods are inserted only *after* role composition (to allow roles to supply implementations, perhaps?) 13:29
jnthn Yes 13:30
SmokeMachine jnthn: this is my problem:
m: role R {COMPOSE {say ::?CLASS.^find_method("bla")}}; class C does R {has $.bla}
camelia ( no output )
jnthn OK, so then you'd want it to run post-COMPOSE...
Or at least...post...something :)
SmokeMachine is COMPOSE running at the same place as the role body? 13:31
jnthn I've no idea because I don't thing it was ever defined :P
*think
Suppose we did introduce a COMPOSE that runs at a different, later, time to code in the role body. 13:32
SmokeMachine that would work if the role body just run after the creation of those methods...
jnthn That's impossible :)
SmokeMachine yes, I think compose should run later then... 13:33
SmokeMachine but probably it shouldn't be called COMPOSE... 13:35
jnthn Even then, we get to the "later, but when?" problem 13:38
If it runs after attribute composition then your use case works, but it's too late to add more attributes
If before attribute composition then we can but vice versa :) 13:39
SmokeMachine then shouldn't exists phasers for both? 13:42
jnthn: ^^ 13:43
jnthn Not sure it's worth it 13:45
I mean, it feels too niche to deserve a phaser
Mixing in to the meta-object, overriding the appropriate method, doing what you wish, followed by a callsame, or preceded by a callsame, is likely more scaleable 13:47
(Than trying to add/name a bunch of phasers then explain when they run)
SmokeMachine m: role R {method ^compose(|) {say ::?CLASS.^find_method("bla")}}; class C does R {has $.bla} # I tried that too... it complains about creating a multi... 13:49
camelia rakudo-moar 87d40a: OUTPUT«Potential difficulties:␤ Useless declaration of a has-scoped method in multi (did you mean 'my method compose'?)␤ at <tmp>:1␤ ------> 3role R {method7⏏5 ^compose(|) {say ::?CLASS.^find_method(␤»
SmokeMachine m: role R {method ^compose(|) {callsame; say ::?CLASS.^find_method("bla")}}; class C does R {has $.bla} # I tried that too... it complains about creating a multi...
camelia rakudo-moar 87d40a: OUTPUT«Potential difficulties:␤ Useless declaration of a has-scoped method in multi (did you mean 'my method compose'?)␤ at <tmp>:1␤ ------> 3role R {method7⏏5 ^compose(|) {callsame; say ::?CLASS.^fi␤»
jnthn m: role R { $?CLASS.HOW does role { method compose_repr(Mu \type) { callsame; say self.find_method(type, "bla") } } }; class C does R { has $.bla } 13:51
camelia rakudo-moar 87d40a: OUTPUT«bla␤»
jnthn That seems a suitable point
SmokeMachine jnthn: great! thanks! 13:52
m: role R { $?CLASS.HOW does role { method compose_repr(Mu \type) { callsame; say self.find_method(type, "bla") } } }; class C does R { has $.bla }; role S {}; class D does S {has $.bla} 13:55
camelia rakudo-moar 87d40a: OUTPUT«bla␤»
SmokeMachine just one bla... great! thanks!
jnthn Yeah, you're mixing into the individual meta-object instance, not altering the meta-type :) 13:57
[Coke] should go get moar coffee. 14:15
abraxxa moar is always good! 14:17
timotimo m: say 1920 / 1080; say 460 / 215 14:19
camelia rakudo-moar 87d40a: OUTPUT«1.777778␤2.139535␤»
timotimo enh :\
Geth oc/master: 4 commits pushed by coke++ 14:37
melezhik_ Hi! 14:42
melezhik_ how one may interpolate varibale into here string? 14:44
[Coke] have you read through docs.perl6.org/language/quoting#in...s%3A_%3Ato yet? 14:45
There's an example there that shows an interpolation.
(searching for "heredoc" instead of "here string" finds that)
melezhik_ Coke: thanks 14:47
it will be qq:to/END/
travis-ci Doc build passed. Will "Coke" Coleda 'fix typos' 15:12
travis-ci.org/perl6/doc/builds/196602501 github.com/perl6/doc/compare/c0353...7ac0beaade
brokenchicken sighs at twitter.com/walt_man/status/825808835558461440 15:25
brokenchicken Wonder if it's invevitable this channel will eventually also turn sour when it grows to more people. 15:26
sena_kun
timotimo i don't think it can be prevented forever, but we'll definitely try to keep it nice in here for as long as humanly possible 15:28
humanly or robotically, i guess
brokenchicken IME it's usually some regular/op who starts going apeshit and others don't do anything about it because they're a regular/op. 15:29
brokenchicken hopes there aren't any logs of his time as op in #css :P 15:30
timotimo how about this
i say
well, if that's your opinion you can just go fuck yourself
and you say
timo, that's way out of line, please leave your computer and calm down for a bit before you chat again
also, please apologize, timo
brokenchicken People telling me to "relax" or "calm down" when I'm pissed off just pisses me off even more :P 15:31
timotimo hm, true 15:32
SmokeMachine jnthn: that worked on my code! thanks!
timotimo can we somehow condition our ircers to respond to abusive people semi-automatically? 15:33
jast my eperience has been that while small squabbles will always happen at some point, all in all it's perfectly possible for a big channel to stay human 15:47
perlpilot Have you guys seen that talk by Clay Shirky on where he talks about the Shinto shrine being rebuilt ever 20 years or so? If not, here it is: www.youtube.com/watch?v=Xe1TZaElTAs&eurl The exact same thing applies to IRC channels. We rebuild it every day how we want it to be. We just need to make sure we're diligent in putting more of the "good stuff" in keeping the "bad stuff" out (though some will sneak in because we're human) 16:01
japhb brokenchicken: Is there anything bystanders can say that *does* calm you down when you're pissed off? 16:02
perlpilot japhb: "Help! We need an op to kick brokenchicken!" ;-> It might not calm him down, but the net effect on the channel could be positive anyway ;) 16:07
brokenchicken japhb: "you're being a dick" 16:11
japhb brokenchicken: Do you find it better to say that in PM or in channel? 16:13
brokenchicken japhb: in channel 16:15
japhb brokenchicken: Interesting. That means people need to keep a map of human => calming method, because there are definitely some people for whom saying "you're being a dick" in channel would *really* set them off, precisely the opposite of you. 16:17
brokenchicken
.oO( sounds like we need another bot... )
16:19
japhb wonders if we could have a "safe word" for in-channel calming of regulars, that we all agree will work on us ...
brokenchicken :)
+1
moritz shenenigans?
japhb initially thought "eggplant", because it's an intrinsically humorous word, but then emoji went and ruined it for us 16:20
timotimo hm, isn't eggplant the best emoji? 16:21
moritz is eggplanting the new bikeshedding?
japhb It just drags too much cultural baggage with it 16:22
japhb shenanigans is a good word, but for some reason I want to keep that available for describing hacky code 16:22
japhb goes AFK 16:24
[Coke] remembers shenanigans from "super troopers". 16:27
moritz maybe "shiboleet" would be better: xkcd.com/806/ :-) 16:28
perlpilot moritz++ 16:30
brokenchicken hehe moritz++ 16:30
b2gills brokenchicken: Knowing that telling you to calm down, pisses you off further. I would still do it, if for no other reason than to let the other person know that this type of behaviour is not the norm. 16:52
How about we just tell anybody that is being persnickety that they are currently being LTA 16:54
TimToady masak: Speaking of gravity, both Texans and Aussies would be insulted at your categorization of my hat. 17:14
jdv79 where's the good vim perl6 highlight stuff? my vim is too janky 17:26
jdv79 is tempted to turn it off
timotimo the vim highlighter is only bad if you have a line that contains many minus signs 17:28
i have to ctrl-c every time i scroll somewhere where there's a line like that
brokenchicken b2gills: that sounds very strange to me :) You wish to indicate to one person the behaviour is not the norm by deliberately soliciting it from the other person :) 17:34
jdv79 timotimo: huh. mine just slows down over certain lines. like a inconsistenly bumpy road. 17:37
not many minus signs
timotimo hm 17:38
jdv79 i'll try installing the newest plugin 17:39
jdv79 huh, still a little janky 17:49
when running the cursor over code
w/e
SmokeMachine brokenchicken: everything has changed on perl7 again? 19:20
sena_kun SmokeMachine, it's rapid development in action. ;) 19:24
SmokeMachine :) 19:28
sena_kun Actually, it is kind of impressive how a small compiler can be written in 300 loc. With borrowed (AFAIK) AST. And with an already written execution platform. And with a grammar instead of some parser. I wrote a simple functional language this winter, but with a parser from scratch, pretty-printer, execution environment and such it has grown in ~600 loc. And it was really bad and incomplete implementation. 19:37
rindolf jdv79: hi 19:44
brokenchicken sena_kun: yup. And it comes with all the profiles and debug outputs Rakudo comes with! 19:51
*profilers
lizmat starts working on the P6W 19:52
so if you have any news you think I missed, let me know!
stmuk_ I'm hoping to get a R* release out in the next hr or so 19:53
lizmat well, I'll be busy for another hour so, I think :-) 19:54
sena_kun brokenchicken, judging by the brief looking at the code, more precisely is it just a translator from your code text to QAST ops? 19:56
brokenchicken sena_kun: nqp is a compiler-building toolchain. I've used it to build a compiler. Not sure what you mean by "just a translator" 19:59
stmuk_ 007 seems broken
Could not locate compile-time value for symbol Val::Array
lizmat stmuk_: feels like a lexical use issue ?
paging masak 20:00
sena_kun brokenchicken, just my terminology-related nonsense, nevermind it. ;)
SmokeMachine w for weekly?! I thought that was this github.com/zostay/P6W 20:12
lizmat SmokeMachine: yeah, the Perl 6 Weekly 20:14
SmokeMachine lizmat: you are doing a great job on that! 20:15
lizmat SmokeMachine: thank you :-)
SmokeMachine is there any module that implements p6w? 20:25
jdv79 rindolf: sup? 20:26
stmuk_ rakudo.org/2017/01/30/announce-raku...e-2017-01/ 20:28
rindolf jdv79: I investigated and wrote a fix for an inkscape crash the other day
jdv79: a whole day spent to produce an 8 lines patch
SmokeMachine November 2016 release of “Rakudo Star”? 20:36
stmuk_: ^^ 20:37
dalek href="https://perl6.org:">perl6.org: d5169ac | (Steve Mynott)++ | source/ (2 files):
Rakudo Star 2017.01
20:42
yoleaux 29 Jan 2017 09:49Z <nine> dalek: Please switch this bot to Geth
stmuk_ SmokeMachine: yes I've just had that pointed out to me in an email and I've fixed the website announce 20:47
I guess noone proof read it in the week before the release! 20:50
stmuk_ for the next one I'll remove some of the hardcoded dates and versions 20:52
jdv79 rindolf: cool 20:54
rindolf jdv79: how are you doing?
stmuk_ I can't face rakudo.org/how-to-get-rakudo right now but will do tomorrow if noone else gets there first! 20:57
brokenchicken Hm, took me a bit to notice x86 Win Star is a year old. 21:04
[Coke] .tell dalek please switch this bot to use Geth.
yoleaux [Coke]: I'll pass your message to dalek.
stmuk_ brokenchicken: I have wondered if it should be removed
[Coke] at this point, I would say yes. maybe update the README to explain why. 21:05
stmuk_ brokenchicken: oh thanks for the automatic display on rakudo.org/downloads/star/
[Coke] brokenchicken++ 21:06
stmuk++
jdv79 rindolf: nothing amazing. trying to golf a p6 bug atm. 21:10
rindolf jdv79: ah, good luck with that? 21:11
jdv79: does it happen with rakudo/moarvm?
jdv79 ues 21:11
*yes
jdv79 but right now i can only repro it in a non-trival piece of code 21:12
of course
timotimo oh my gosh i have internet access! 21:25
brokenchicken What luck... Went to buy Witcher III game and turns out it's on a "daily deal" today and is 40% off.... And the best part? Turns out I already bought it last May and just forgot about it :P 21:26
timotimo: welcome to civilization!
okeuday_bak If I have "use 5.010;", in some perl5 code, won't perl6 execute the source code as perl5 code? 21:44
brokenchicken okeuday_bak: no, Perl 6 is an entirely different language
buggable: eco perl5 21:45
buggable brokenchicken, Found 4 results: Digest::MD5, Web::Scraper, Inline::Perl5, Pod::Perl5. See modules.perl6.org/#q=perl5
brokenchicken buggable: eco inline::perl5
buggable brokenchicken, Inline::Perl5 'Use Perl 5 code in a Perl 6 program': github.com/niner/Inline-Perl5
brokenchicken See that ^
okeuday_bak brokenchicken: I understand perl6 is separate, but older information appeared to indicate that perl6 would still accept perl5 source code, but I don't remember where I read about that
brokenchicken okeuday_bak: Inline::Perl5 provides *interoperability* which is mandated by the specification, but that doesn't mean you can just write Perl 5 code and it'll work. 21:46
okeuday_bak brokenchicken: what does it mean then?
stmuk_ okeuday_bak: that was the "v5" project which I dont think has progressed recently 21:47
brokenchicken okeuday_bak: that if you want to use Perl 5 modules or code, you use Inline::Perl5
okeuday_bak stmuk_: k
brokenchicken: k, so you must always call through Perl6 to use Perl5, and only through that extra dependency 21:48
stmuk_ github.com/rakudo-p5/v5
perlpilot or just use Perl 5 directly without Perl 6 at all :-) 21:49
lizmat I think the main problem of the v5 project is to target which version of Perl 5
especially with all of the "recent" syntactic additions such as postderef syntax
stmuk_ I recall there was a basic issue with trying to run perl 5 tests 21:50
okeuday_bak tis ok, I mainly wanted to check if I could test perl5 code with perl6, to see what would happen
RabidGravy am I the only person who finds the postfix deref ugly
stmuk_ wasn't it something to do with "goto"?
lizmat RabidGravy: no
RabidGravy good 21:51
stmuk_ RabidGravy: I thought it was pointless tinkering like much of the perl 5 changes of late
RabidGravy people started to use it at work and I just want to remove it
perlpilot stmuk_: I don't think it was pointless. It was done for a similar reason P6 moved the regex modifiers to the front I think. Only there they *wanted* the end-weight because of how the expression reads 21:53
perlpilot (but ... it is ugly) 21:53
timotimo lied 22:02
internet connection is super terrible
brokenchicken Ugly? The ->*@ is much nicer than @ with braces wrapping the entire line 22:11
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2017/01/30/...e-mondays/
brokenchicken wooo \o/
lizmat also: shop.oreilly.com/product/0636920065883.do # Think Perl 6 :) 22:12
brokenchicken oh wow, another book! 22:13
gfldex i'm do not agree to the colouring of that butterly!
perlpilot Hmm. There will be too many butterflies at this rate.
brokenchicken huggable: books 22:14
huggable brokenchicken, "Perl 6 At A Glance" deeptext.media/perl6-at-a-glance/ (print only for now); "Perl 6 By Example": leanpub.com/perl6 (can order preview digital copies)
perlpilot perlpilot's law of Perl 6 books -- everyone wants the butterfly
brokenchicken huggable: books :is: "Perl 6 At A Glance" deeptext.media/perl6-at-a-glance/ (print only for now); "Perl 6 By Example": leanpub.com/perl6 (can order preview digital copies) ; "Think Perl 6: How to Think Like a Computer Scientist": shop.oreilly.com/product/0636920065883.do
huggable brokenchicken, Added books as "Perl 6 At A Glance" deeptext.media/perl6-at-a-glance/ (print only for now); "Perl 6 By Example": leanpub.com/perl6 (can order preview digital copies) ; "Think Perl 6: How to Think Like a Computer Scientist": shop.oreilly.com/product/0636920065883.do
lizmat I understand there will be early edition e-books available in a few days 22:15
brokenchicken sweet 22:16
brokenchicken lizmat++ good weekly 22:20
gfldex brokenchicken: did you doc sub `foo:bar<42> {}` ? 22:22
gfldex m: my &c = sub foo:bar<42> { say 'oi‽' }; my $a = 42; foo:bar«$a»() 22:28
camelia rakudo-moar 3e28b1: OUTPUT«Use of uninitialized value $a of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤ in code at <tmp> line 1␤5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤…»
gfldex m: my &c = sub foo:bar<42> { say 'oi‽' }; my $a = 42; foo:bar«42»() 22:29
camelia rakudo-moar 3e28b1: OUTPUT«oi‽␤»
gfldex am I asking too much?
geekosaur gfldex, I think that is compile time 22:30
gfldex m: my &c = sub foo:bar<42> { say 'oi‽' }; constant $a = 42; foo:bar«$a»() 22:31
camelia rakudo-moar 3e28b1: OUTPUT«oi‽␤»
gfldex neat :->
geekosaur m: my &c = sub foo:bar<42> { say 'oi‽' }; BEGIN my $a = 42; foo:bar«$a»() 22:32
camelia rakudo-moar 3e28b1: OUTPUT«oi‽␤»
gfldex m: class C { method m:a<42> { say 'oi!' } }; C.new.(m:a<42>)(); 22:33
camelia rakudo-moar 3e28b1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Adverb a not allowed on m␤at <tmp>:1␤------> 3 m:a<42> { say 'oi!' } }; C.new.(m:a<42>7⏏5)();␤»
gfldex m: class C { method m:a<42> { say 'oi!' } }; C.new.m:a<42>(); 22:34
camelia rakudo-moar 3e28b1: OUTPUT«No such method 'm' for invocant of type 'C'␤ in block <unit> at <tmp> line 1␤␤»
brokenchicken Oh, cool. Didn't know you could use variables there 22:35
gfldex constant variables in that case :)
and it may not be in roast (didn't check) 22:36
brokenchicken m: BEGIN my $z = 42; my &c = sub foo:bar«$z» { say 'oi‽' }; BEGIN my $a = 42; foo:bar«$a»() 22:37
camelia rakudo-moar 3e28b1: OUTPUT«oi‽␤»
brokenchicken gfldex: but no, I didn't document anything. It was more of a "the custom op category is too eager in rejecting stuff so it hits subs with extended colonpairs" fix: github.com/rakudo/rakudo/commit/48...278063462a 22:38
and doesn't affect methods/grammar things since these worked on them already 22:39
samcv I know I can get a variables name using .VAR.name. but what if I want to set a variable programmatically to something 23:13
at runtime
without using eval
geekosaur m: my $a = 5; my $b = '$a'; ::($b) = 6; dd $a 23:18
camelia rakudo-moar 3e28b1: OUTPUT«Int $a = 6␤»
samcv nice
travis-ci Doc build passed. Antonio Quinonez 'added newlines' 23:29
travis-ci.org/antquinonez/doc/builds/196744792 github.com/antquinonez/doc/commit/0c6a786b4310
timotimo home again, where the internet's good 23:40
brokenchicken \o/ 23:52