»ö« 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.
lookatme morning, morning .. 01:00
raschipi Look at the European 01:01
lookatme Here is +8 zone 01:05
raschipi Even more European than the people that live in Europe, than. 01:07
lookatme Em --? 01:10
haxmeister so zef is failing to install Selenium::WebDriver with the following error: pastebin.com/77kKeCHe 01:35
haxmeister and it locks up there too... have to ^c to get out of it 01:36
lookatme I think it's problem of Selenium::WebDriver. 01:55
The test failed.
haxmeister well I have chromium browser.. and it popped open like 15 windows due to the test
I just installed chrome browser.. maybe it will succeed??.. 01:56
lookatme Is the document of the module said something about test ? 01:57
Such as you have install something .. etc
haxmeister nope 01:58
is chrome test
of some sort
launches chrome windows to nowhere
look at screenshot imgur.com/fRRNZBr 02:02
lookatme I don't know.. 02:04
haxmeister weird eh?
lookatme Em, maybe it's a bug... 02:05
Have you google it ?
haxmeister no.. I'm digging 02:07
lookatme Em, I notice that have a ChromeDriver, have you installed it ? 02:10
choz mornin all 02:11
im newb in perl, anyone knows what is '\$6' in this command do? `perl -e 'print crypt("password","\$6") . "\n"'` 02:12
haxmeister encryption level? 02:13
choz is that a variable?
choz coz when i try to run it, it'd return nothing.. 02:14
raschipi choz: It's not, the "$" is being escaped. 02:15
But I have no idea what it means, though.
choz i see 02:15
anyway, thx fyi raschipi n haxmeister 02:16
MasterDuke_ i think that's the salt. at maybe it's saying to run 6 rounds of crypt?
raschipi That's another language. There's two with the same name. 02:16
MasterDuke_ *and maybe
choz oh
raschipi We talk Perl6, but that's Perl5.
geekosaur on linux that means to use sha-512 02:17
man 3 crypt
haxmeister $1 would be md5 crypt 02:18
lookatme It's a salt `char *crypt(const char *key, const char *salt);`
choz so \$6 is an ID of glibc salt 02:19
haxmeister $6 sha-512
choz ive got it not
now*
geekosaur lookatme, that interpretation is 7th edition unix
it does more now
haxmeister have to escape the $ for bash to send it proper
choz i think ive got what i have to do next..
tq wizards.. 02:20
geekosaur no, it's single quoted. but it's in a double quoted perl string inside the single quoted shell string, because you can't nest a single quoted string inside another in a shell
haxmeister ^this
geekosaur so it has to escape the $ against perl
haxmeister he's right^
geekosaur (alternately they could have used q/$6/ or something)
haxmeister selenium :(
haxmeister interesting... it doesnt' like the chromedriver that comes with chromium and to install chromdriver independantly I have to uninstall chromium 02:32
oh the life...
we'll see if it works this time
haxmeister failed again 02:37
haxmeister pastebin.com/Bssi9TT0 02:38
haxmeister man I have no idea what to do with that information 02:41
MasterDuke_ looks like File::Temp failed a test, but the test has something to do with GC, so maybe it's just a timing error or something like that 02:42
haxmeister I don't even know what GC is referring too 02:43
MasterDuke_ could manually install File::Temp with --force and then try Selenium::WebDriver again
garbage collection
haxmeister ah ok
I'll try again with no changes 02:44
MasterDuke_ yeah, it might be good to create an issue in the File::Temp repo if the test is failing for no good reason 02:45
haxmeister passed temp that time
haxmeister fingers crossed 02:45
choz just realized my crypt didnt work because i didnt close the last '$'.. finally got it working with `perl -e 'print crypt("Awe378437", "\$6\$"). "\n"'`.. tq for your guys help, really saved me lots of trouble 02:46
haxmeister passed the chrome.t test this time too
haxmeister success?!?!? 02:47
lookatme ...
I tried install File::Temp, no error
It's not stable. :) 02:48
haxmeister the install succeded thsi time 02:54
so I'll to a little test after a break 02:55
lookatme It's not easy install that module .. XD 02:57
haxmeister simple test script worked 03:08
well.. partially 03:09
samcv lookatme, os? 03:30
lookatme os ?? 03:31
lookatme samcv, what the mean? fedora 25 ?. 03:34
samcv that is an acceptable answer 03:35
lookatme :)
samcv you colud steal my implementation 03:36
github.com/perl6/doc/blob/master/h...#L962-L970
samcv the extra code is qust to code for that 1 in a million chance that you get the same one. but very important for langer running programs 03:36
lookatme What implementation ? Oh I just test that File::Temp installation 03:37
samcv oh so you aren't usig tnhe module directly
lookatme I don't need that module
samcv oh ok
lookatme Yeah..
samcv Your printf-style directives specify 1 argument, but 1000000 arguments were supplied 03:38
hehehe
1 million arguments
lookatme OH, I see it. 03:41
lookatme The temp file will save on the disk ? 03:44
samcv idk what command are you using? 03:45
the code i linked or something else 03:46
lookatme It's better create a FIFO file instead of that temp file on the disk. 03:47
samcv depends on what you're doing
lookatme Yeah 03:48
Have lunch now, see you. 03:50
grondilu Hello, I was looking at rosettacode.org/wiki/Bernoulli_numbers#Perl_6, and I tried to shorten it a bit by making @a a state variable. 05:49
Turns out state @a = ... fails, but (state @a) = ... works.
I'm not sure the semantics is supposed to be different. 05:50
grondilu m: say gather for ^Inf { (state @a) = 1/($_+1), +@a*(@a.shift-*) ... {!@a}; take @a.tail if @a.tail }[^10] 06:04
camelia (1 0.5 0.166667 -0.033333 0.023810 -0.033333 0.075758 -0.253114 1.166667 -7.092157)
grondilu m: say gather for ^Inf { state @a = 1/($_+1), +@a*(@a.shift-*) ... {!@a}; take @a.tail if @a.tail }[^10]
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use variable @a in declaration to initialize itself
at <tmp>:1
------> 3ather for ^Inf { state @a = 1/($_+1), +@7⏏5a*(@a.shift-*) ... {!@a}; take @a.tail i
expecting any of:
grondilu this makes sense, not sure why I had a different message earlier 06:05
lizmat_ clickbaits p6weekly.wordpress.com/2017/05/08/...batross_i/ 07:43
parv lizmat, like the name of the command "fix_windows10" ;-> 07:45
lizmat parv: can't take any credit for it :-) 07:52
lizmat is just the messenger on that one
parv lizmat, thing is i don't know who made that; so here is hoping the messenger would pass back my message. 07:54
lizmat El_Che: ^^^ 07:55
parv Aye.
El_Che, interesting command name there, "fix_windows10". 07:56
lookatme :) fix_bug10
samcv .tell Zoffix docs still mention slurp-rest for Proc objects docs.perl6.org/type/Proc 08:23
yoleaux samcv: I'll pass your message to Zoffix.
lookatme samcv, slurp-rest still working for Proc 08:35
samcv i know it still works
that's not the issue. just zoffix is updating the docs to mention 'slurp' instead and that be the preferred one 08:36
lookatme, see message here: docs.perl6.org/routine/slurp-rest
lookatme I see. But in 6.c we still have this method, right ? 08:40
u-ou which operator should I use to compare two objects? 08:48
I know that eq is for strings and == is for numbers so what is for objects?
moritz u-ou: what semantics do you want out of the comparison?
moritz m: class A { has $.x }; say A.new(:x(5)) eqv A.new(:x(5)); say A.new(:x(5)) === A.new(:x(5)); 08:49
camelia True
False
moritz stackoverflow.com/questions/176343/...erators-eq
u-ou that they're the same object 08:50
moritz === then
u-ou thank you 08:51
lookatme u-ou, you can provides a overload of infix:<==> for your class 08:54
u-ou cool
lookatme m: class A { has $.x }; multi sub infix:<==>(A $a, A $b) { say "CALL ME"; True; }; say A.new(:x(5)) === A.new(:x(5)); 08:55
camelia False
lookatme m: class A { has $.x }; multi sub infix:<==>(A $a, A $b) { say "CALL ME"; True; }; say A.new(:x(5)) == A.new(:x(5));
camelia CALL ME
True
samcv lookatme, yes we still have it. but they do *mostly* the same thing 08:57
lookatme samcv, I wonder why they name that method **slurp-rest**.
moritz m: say 1.WHICH.^name 08:58
camelia ObjAt
samcv well. we have slurp now. instead of having slurp and slurp-rest
but slurp and slurp rest literally slurp to the end of the file. but that's basically implied
no reason to say rest
moritz m: class A { has $.x; method WHICH() { ObjAt.new('A') } }; A.new(x=>5) === A.new(x => 6)
camelia WARNINGS for <tmp>:
Useless use of "===" in expression ".new(x=>5) === A.new(x => 6)" in sink context (line 1)
moritz m: class A { has $.x; method WHICH() { ObjAt.new('A') } }; say A.new(x=>5) === A.new(x => 6) 08:59
camelia True
moritz a very egalitarian class
samcv otherwise would be like .slurp-from-beginning or something weird
moritz iirc the question was whether .slurp on a file handle would close the file handle or not
moritz and the reaction was to rename slurp on file handles to something different 08:59
but why -rest, I don't know 09:00
El_Che lo 09:25
scovit hello, where could I find the documentation about the behaviour of Closures in Perl 6? 09:29
scovit found this en.wikibooks.org/wiki/Perl_6_Progr...d_Closures 09:29
is it possible to introspect the state of a Closure? 09:30
like know which variables are in the scope, what is their value, change their value
lookatme docs.perl6.org/language/functions#Closures 09:31
scovit, check out this page
scovit lookatme, thank you. I would like to know if it is possible to manipulate their state? 09:33
lookatme I think you want this : docs.perl6.org/language/packages#P...o-packages
m: { my $x = 10; say MY::.keys; } 09:35
camelia ($_ $*DISPATCHER $x)
scovit good hints! thanks 09:37
lookatme Em, :) 09:38
scovit lookatme, I am trying to understand. For packages I understand it might be possible to achieve what I would like, and that is maybe what I should focus on. What about blocks? 10:00
m: sub ciao(&code) { my $j = "due"; say &code::.keys; }; my $i = "perl"; ciao { say "here"; };
camelia (0)
scovit also, could I create a Package on-the-fly as a closure? 10:01
jnthn Perl 6 is pretty strict about lexicals staying lexical 10:04
There's no way in general to introspect what a closure closes over 10:05
jnthn It is possible to obtain MY:: and pass *that* around 10:05
But the compiler is otherwise free to optimize lexical variables aggressively, including erasing information that would allow their introspection, short of seeing something that requires it in scope (like MY:: or EVAL) 10:06
Geth doc: 164d5534bc | (Zoffix Znet)++ | doc/Type/Proc.pod6
Remove .slurp-rest from Proc examples; samcv++
10:34
bioduds Hello, is this support channel? 11:12
bioduds I'm getting this weird error 11:13
===SORRY!=== QAST::Block with cuid 2 has not appeared
Someone knows what it is related to?
moritz what code did you run? 11:14
bioduds Just trying to implement a test module 11:14
use v6; # SOME DECLARATIVE CODE exemples subset Natural of Int where * >= 0; subset FirstName of Str where 0 < *.chars < 256;
moritz m: use v6; subset Natural of Int where * >= 0; subset FirstName of Str where 0 < *.chars < 256; 11:16
camelia ===SORRY!===
QAST::Block with cuid 2 has not appeared
moritz looks like a bug to me
m: use v6; subset Natural of Int where * >= 0; subset FirstName of Str where { 0 < .chars < 256} ;
camelia ( no output )
moritz bioduds: seems to work with a {} closure
m: subset Foo of Int where 0 < * < 3 11:17
camelia ( no output )
moritz m: subset Foo of Int where 0 < *.sqrt < 3
camelia ===SORRY!===
QAST::Block with cuid 1 has not appeared
moritz m: subset Foo of Int where 0 < *.sqrt
camelia ( no output )
moritz m: subset Foo of Int where 0 < *.sqrt < 3
camelia ===SORRY!===
QAST::Block with cuid 1 has not appeared
moritz m: say (0 < *.sqrt < 3)(4) 11:18
camelia ===SORRY!===
QAST::Block with cuid 1 has not appeared
bioduds moritz: do you understande the problem? 11:18
quite bugish right?
moritz m: say (0 < * < 3)(2) 11:19
camelia True
bioduds weird part is that it was working before 11:20
it started to complaint after I changed to .pl6
moritz bisectable: say (0 < *.sqrt < 3)(4)
bisectable6 moritz, Bisecting by output (old=2015.12 new=20cfd6b) because on both starting points the exit code is 1
moritz, bisect log: gist.github.com/9b0068a0ec1bd53966...c468ed2cf4
moritz, (2015-12-25) github.com/rakudo/rakudo/commit/07...dc61f84053
moritz, The result looks a bit unrealistic, doesn't it? Most probably the output is different on every commit (e.g. 「bisect: say rand」)
moritz bisectable: say so try (0 < *.sqrt < 3)(4) 11:20
bisectable6 moritz, Bisecting by output (old=2015.12 new=20cfd6b) because on both starting points the exit code is 1 11:20
moritz, bisect log: gist.github.com/5cd30d93ce3cf0d0c4...9ce208a9dc 11:21
moritz, (2015-12-25) github.com/rakudo/rakudo/commit/07...dc61f84053
moritz, The result looks a bit unrealistic, doesn't it? Most probably the output is different on every commit (e.g. 「bisect: say rand」)
Zoffix That's a known bug that existed for ages. 11:21
Zoffix It's due to the curry not knowing about being chained 11:21
moritz m: say so try (0 < *.sqrt < 3)(4
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')'
at <tmp>:1
------> 3say so try (0 < *.sqrt < 3)(47⏏5<EOL>
moritz m: say so try (0 < *.sqrt < 3)(4)
camelia ===SORRY!===
QAST::Block with cuid 1 has not appeared
moritz Zoffix: ok, thanks 11:22
Zoffix: there's an RT for that, right?
Zoffix Yeah, should be
Zoffix looks
moritz if yes, won't bother submit it again
bioduds how come it worked before and suddenly, boom
Zoffix bioduds: you may be misremembering it working before
bioduds well, good to know it is a bug then
I may 11:23
anyhow, I don't quite need it, I was just confused. Thanks for pointing out
Zoffix moritz: rt.perl.org/Public/Bug/Display.htm...et-history
and I recall talking about it in #perl6-dev and TT saying it's got to do with curry and chaining or something 11:24
bioduds: in your case you can just remove the asterisk, as the `where` block thunks, so $_ will be the arg and your expression returns True/False 11:25
Zoffix bioduds: also we have UInt for Int >= 0. Though natural numbers generally don't include a 0 so your subset is off a bit 11:30
And the Firstname subset doesn't need the lower bound since chas can't be negative; so just .chars < 256 11:32
bioduds tx Zoffix 11:40
done it 11:41
scovit m: use experimental :macros; macro ciao { quasi { say MY::.keys; } }; my $i = "hello"; say MY::.keys; ciao; 12:58
camelia ($=pod EXPERIMENTAL-MACROS $_ $/ !UNIT_MARKER &ciao $=finish EXPORT $! $i ::?PACKAGE GLOBALish $¢ $?PACKAGE)
()
scovit m: use experimental :macros; macro ciao { quasi { say MY::.keys; } }; my $i = "hello"; ciao;
camelia ()
MasterDuke_ m: use experimental :macros; macro ciao { quasi {{{ say MY::.keys; }}} }; my $i = "hello"; ciao; 12:59
camelia ($_ $*DISPATCHER)
scovit is there some random behaviour or I do not understand 13:00
ah MasterDuke_ sorry
thougth that what was I wrote
so the {{{ }}} defined scope cannot access $i 13:01
MasterDuke_ i have no idea, masak can probably answer though 13:05
curt_ Docs have Instant.Date (docs.perl6.org/type/Instant#method_Date) but not Instant.DateTime (though Rakudo has it implemented) 13:06
[Coke] wonders how hard it would be to make a module that let you use [] for substr. 13:12
Ulti is there a way to add your own encodings to stuff like Bug.decode do you just monkey in the candidate 13:24
*Buf.decode
Ulti thinking of adding 2bit format for compactly keeping DNA sequences in memory and it would be nice to have the decode to a character representation be kind of generic rather than something special I create in the library 13:26
Ulti something like this? gist.github.com/MattOates/363ce81f...9b4e641f38 13:32
jnthn Ulti: Not yet, though pluggable encodings is something on my todo list
Ulti ahh cant augment Blob 13:36
Ulti so why is Blob closed for augmentation but Int is not I thought one of the main reasons was perf? 13:42
jnthn Blob is a role 13:44
Int is a class
Ulti ok so Id end up making my own 2bit class by the looks of it anyway similar to the utf8 ones defined in Rakudo 13:49
[Coke] m: say 1-(1-9.95)**(1/3) 13:52
camelia NaN
[Coke] m: say 1-(1-0.95)**(1/3) #oops 13:54
camelia 0.631596850135961
Ulti sorry why is the first one a problem 13:56
[Coke] m: say sqrt(-2) 13:58
camelia NaN
[Coke] ^^
I assume we don't like roots of negative numbers, even though it might work. 13:59
Ulti m: -2.sqrt.say 14:00
camelia WARNINGS for <tmp>:
Useless use of "-" in expression "-2.sqrt.say" in sink context (line 1)
1.4142135623731
Ulti m: say(-2.sqrt)
camelia -1.4142135623731
[Coke] m: say (-2).sqrt
camelia NaN
[Coke] precedence.
Ulti yeah its - after the fact with 2.sqrt I guess
[Coke] but my original equation should be 3.076 or so. rakudobug?
Ulti it also doesnt matter if you get it away from Rat 14:01
[Coke] m: say 1-(1-9.95)**.333333333
camelia NaN
Ulti well .3 is still a Rat right so thats identicalish 14:02
but yeah weird
surely someone would have noticed this before now so is it a regression?
people have played with 2D mechanics and graphics where you're likely to write almost exactly this code 14:03
raschipi bisectable: say 1-(1-9.95)**.333333333
bisectable6 raschipi, On both starting points (old=2015.12 new=20cfd6b) the exit code is 0 and the output is identical as well
raschipi, Output on both points: «NaN»
Ulti o___O 14:04
also whoa bisectable is fast
moritz why does anybody think this is a regression?
if you want complex numbers, you need to start with a complex number
m: say 1-(1-9.95+0i)**.333333333 14:05
camelia -0.0381123313882117-1.79806329757973i
moritz and it's always[tm] been this way, since we don't want to burden the not-so-mathematically-inclined programmer with complex numbers if they just made the mistaken of taking an sqrt (or comparable) of a negative number 14:06
Ulti yeah I guess that's fair
plus with the precedence just pointed out it might be super confusing 14:07
raschipi What's happening is automatic promotion from Rat to Num, because Rat has limited precision.
FatRat doesn't promote to Num. 14:08
Rat is limited to 64 bits in the denominator.
[Coke] moritz: it's not complex though. you can cube root a negative real and get a negative real. Is it just complex because we don't have literal cube root and are approximating? 14:16
m: say 64**(1/3)
camelia 4
[Coke] m: say (-64)**(1/3)
camelia NaN
[Coke] m: say (-64+0i)**(1/3) 14:17
camelia 2+3.46410161513775i
moritz [Coke]: right, but we disallow fractional powers of any negative number, which is a common practise in numerical implementations
[Coke] hokay.
it was the wrong equation for my particular problem anyway, so I'm all set. :)
Geth doc: b4e10b6fbe | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Instant.pod6
Document Instant.DateTime; curt_++

coverage report shows it as covered; so it's likely in roast
14:21
Geth doc: 75abdd5b79 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Instant.pod6
Reword

  - Shorten description
  - Remove confusing comment, as it implies the method is not portable, but it is
14:22
mscha m: say 243.log(3); .say for 0 .. 243.log(3); # I hate invisible rounding problems. 😡 16:31
camelia 5
0
1
2
3
4
timotimo m: say 243.log(3) - 5 16:31
camelia -8.88178419700125e-16
timotimo yeah, that's far behind the comma
mscha Problem is, you can't really add a delta, no matter how small, because then you might get a value that's too high. 16:33
Oh well, I'll do it without .log().
TimToady m: say 243.log(3); .say for 0 ... * ≅ 243.log(3);
camelia 5
0
1
2
3
4
5
mscha m: .say for 1, 3, 3² ... 243; # this is prettier anyway 16:34
camelia 1
3
9
27
81
243
timotimo 'tis
TimToady :D
m: .say for 3⁰, 3¹, 3² ... 243; 16:35
camelia 1
3
9
27
81
243
curt_ m: my $i = -0x8000000000000000; say ($i div 2**12) == ($i +> 12) ?? 'good' !! 'bad'; 16:36
camelia good
curt_ m: my $i = -0x8000000000000000; say ($i div 2**37) == ($i +> 37) ?? 'good' !! 'bad';
camelia bad
TreyHarris m: say 9**(-1/2) 16:39
camelia 0.333333333333333
curt_ m: my $i = -0x8000000000000000; say ($i div 2**23) == ($i +> 23) ?? 'good' !! 'bad'; 16:40
camelia good
curt_ m: my $i = -0x8000000000000000; say ($i div 2**42) == ($i +> 42) ?? 'good' !! 'bad';
camelia bad
TimToady loks like a bug 16:41
*oo
at the 32-bit boundary
TimToady m: my $i = -0x8000000000000000; say ($i +> 31) 16:41
camelia -4294967296
TimToady m: my $i = -0x8000000000000000; say ($i +> 32)
camelia -1
TimToady please report bug 16:44
TimToady heads to Fry's yet again for more capacitors... 16:45
timotimo did you fry your capacitors?
TimToady ancient Tivo power supply, have replaced most of the caps already, but of course it's the one I forgot to buy that is the busted one, seemingly 16:46
anyway, the 12v line is only making about 6v
can actually hear the cap arcing, a little snick-snick noise 16:47
I wouldn't put so much work into this, except it's the Tivo with the lifetime subscription :)
also put a new capacitor into my air conditioner condenser last week, but that single cap easily outweighed all the boards in my Tivo :) 16:49
TreyHarris TimToady: heh, hope you've stuck ethernet and a bigger hard drive on it if it's old enough for that
TimToady it's the early HD model, so already has ethernet 16:50
TreyHarris Ah... the ones before that had ethernet--as headers on the board. So you could connect it but you had to run a cable through the chassis. Turned out the fan was smaller than the outlet by _just_ enough to get a thin cable out. 16:51
TimToady had an external 500G, but plan to replace internal with 2T and forget the external
I don't think I'd futz with a low-def tivo, since I'm a bit of a video snob :) 16:52
TreyHarris TimToady: I've got two from my cable company now--RCN just uses honest-to-god TiVos as their cable boxes, bless them 16:53
curt_ Bugged: bit shift broken at 32 bits: rt.perl.org/Public/Bug/Display.html?id=131278
TimToady curt_++
that took less time than me not going to Fry's :)
afk &
curt_ -1 looks like the intended output for big shifts: rt.perl.org/Public/Bug/Display.html?id=126942 16:59
curt_ Work around for big bit shifts, just do two of them less than 32 17:04
m: my $i = -0x8000000000000000; say ($i div 2**37) == ($i +> 31 +> 6) ?? 'good' !! 'bad';
camelia good
alphah Hello, what would be a good way to call a method by a variable has it's name, something like $var="methodname"; self.$var 17:17
m: class C { has $!var = "foo"; method foo() { "hello" }; method bar() { say self.$!var } }; C.new.bar
camelia No such method 'CALL-ME' for invocant of type 'Str'
in method bar at <tmp> line 1
in block <unit> at <tmp> line 1
jnthn self."$var"()
jnthn Or self."$!var"() in that case 17:17
alphah jnthn: worked, thank you 17:18
alphah That works for methods, does it also works for attributes? 17:36
class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { say self.$attr.hello } }
m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { say self.$attr.hello } }
camelia ( no output )
alphah m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { say self.$attr } } 17:37
camelia ( no output )
alphah class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { say self.$attr.hello0o } } # why no error! 17:40
m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { say self.$attr.hello0o } } # why no error! 17:41
camelia ( no output )
timotimo alphah: public attributes are always accessed via accessor methods, so yes, it should work 17:45
alphah timotimo: in this example should not it call .hello ?: 17:48
ufobat should perl6 build on a raspi in the meanwhile?
alphah m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { self.$attr.hello() } }
camelia ( no output )
timotimo i have cat on me
timotimo self.$attr calls $attr as a code object and passes self as invocant 17:49
cant properly type with cat on me 17:50
you don't get an error because you're not calling any of the code 17:51
alphah hmm
tried slef.$attr.new.hello 17:52
timotimo well, as long as it's inside method foo of class B and you're not doin something like B.new.foo
nothing's gonna happen
you won't get a compile error because the $attr that gets passed could be a code object
even though the default case would almost guaranteed give you an exception, we don't do analysis like that 17:53
okay, cat left 17:55
alphah okay, so what I'm trying to do is: I have a class which has 3 attributes , each one is an instance of different class,,, I want to create a method takes "string" arg, and use the instance that matches this string
timotimo m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { self.$attr.hello() } }; B.new.foo 17:55
camelia No such method 'CALL-ME' for invocant of type 'Str'
in method foo at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo ^- there's the error you were expecting
timotimo in what way does the instance match the given string? 17:56
m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { self."$attr".hello() } }; B.new.foo
camelia 5===SORRY!5=== Error while compiling <tmp>
Quoted method name requires parenthesized arguments. If you meant to concatenate two strings, use '~'.
at <tmp>:1
------> 3; method foo($attr = "a") { self."$attr"7⏏5.hello() } }; B.new.foo
alphah just the name
timotimo m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { self."$attr"().hello() } }; B.new.foo
camelia hello
timotimo m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { self."$attr"().hello() } }; B.new.foo("bleh")
camelia No such method 'bleh' for invocant of type 'B'
in method foo at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo does that solve your problem? 17:58
alphah let me try that
yes worked :) 18:00
what confused me is I did not think I will need the "()" for the attributes... now understand 18:01
timotimo yeah accessors are just methods 18:02
that was the number one confusing thing for me near the beginning
alphah noted
timotimo i was like "but the attribute is called $.foo, why don't i write self.$foo or something?
or maybe $self.foo?"
etc etc
alphah yes exactly, that was my thought just 1 minute ago 18:03
timotimo but self.$foo is really like $foo(self)
skids m: my $b; (loop ($b = 4; $b; $b--) { next if $b == 1; $_ }).note 18:05
camelia ((Any) (Any) (Any) (Mu) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (A…
skids That only happens if you next out of the last iteration.
timotimo oh, fascinating 18:06
skids files an RT 18:08
m: my $b; (loop ($b = 4; $b > 0; $b--) { next if $b == 1; $b }).note # version without escaping the termination condition 18:13
camelia (4 3 2 (Mu))
skids still have that Mu.
skids RT #131281 18:17
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=131281
skids Ooh. also affect while. 18:19
m: my $b =4; (while ($b--) { next if $b == 0; $b }).note
camelia (3 2 1 (Mu) -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -6…
Geth ecosystem: 9ecab7fd65 | (Zoffix Znet)++ (committed using GitHub Web editor) | META.list
Add Pythonic::Str to ecosystem

Index into strings like Pythonists do! See: github.com/zoffixznet/perl6-Pythonic-Str
18:37
tadzik ha! This is cool 18:44
timotimo yo tadzik 18:46
what is?
tadzik Pythonic::Str 18:49
I have 4 python students this week, and when I told them that I work with Perl some of them looked... jealous
timotimo huh 18:50
that's new
tadzik an ex-Perlist I suppose, not happy about the transition
timotimo hmm 18:50
imgur.com/R7T4Gzn - tadzik i wanted you to see this 18:51
tadzik looks
oh dayum
it's beautiful
I can't unsee die katze
timotimo <3 18:52
die katze also sees you
tadzik have you githab it? 18:53
ah, I see it
timotimo yup
it also comes with a tool that creates a nice graphviz'd render of the whole callgraph
tadzik how's it faring with very big profiles?
mmm 18:54
timotimo it fares perfectly because it uses sqlite
tadzik right, but does it render the things in reasonable time, compared to angular?
timotimo it does a pretty different thing
why's the irclog down? :(
tadzik what I mean is, I wonder if it's viable to port p6profiler-qt to Perl 6 18:55
(and Gtk)
timotimo yeah, it probably is
tadzik hmm :)
timotimo as long as you go with sqlite instead of json :)f
tadzik yup
timotimo hack.p6c.org/~timo/forestfire_callgraph_3.svg - check it 18:56
tadzik right, it was mostly rendering that brought the web profiler down
ayy, neat!
timotimo ayyyyyyyyyyy
raschipi lmao 19:09
AlexDaniel Ulti: re “whoa bisectable is fast”, it only had to try 2 revisions, so that's not so impressive :) 19:15
in fact, it is a bit slow because both revisions were compressed (even though it could have kept HEAD and 2015.12 uncompressed to speed things up)
so that's like 0.1s overhead per revision or something like that 19:16
timotimo sasheldon.com/blog/2017/05/07/how-i...r-windows/ - heh. 19:43
raschipi heh 19:46
[Coke] win 3 20:18
buggable [Coke], Thank you for entering Accidental /win Lottery! The next draw will happen in 4 weeks, 2 days, 3 hours, 41 minutes, and 50 seconds
raschipi win 9223372036854775807 20:21
buggable raschipi, Thank you for entering Accidental /win Lottery! The next draw will happen in 4 weeks, 2 days, 3 hours, 38 minutes, and 42 seconds
raschipi m: say "win 12" 20:22
camelia win 12
haxmeister win 5 20:51
buggable haxmeister, Thank you for entering Accidental /win Lottery! The next draw will happen in 4 weeks, 2 days, 3 hours, 8 minutes, and 8 seconds
haxmeister what's that all about? 20:52
haxmeister just installed moritz JSON module 20:53
raschipi Zoffix owns it.
haxmeister the module? 20:54
raschipi No, the bot
raschipi The bot function, should I say 20:54
haxmeister got me excited for a minute there
samcv how do i traverse the grammar entries
in an actions class. in order that is
from how they are displayed when i dump $/ i need to access that inside TOP 20:55
hmm actually i think if i add another heirarchy i can do this
jnthn samcv: Positional captures in .list, named in .hash, and iirc .caps give you all of them in the order they happened 20:57
samcv what do i call .list on?
$/?
jnthn Ues
*Yes
samcv cool
alphah win 7 20:58
buggable alphah, Thank you for entering Accidental /win Lottery! The next draw will happen in 4 weeks, 2 days, 3 hours, 1 minute, and 52 seconds
samcv jnthn, that does not work. $/.list inside of TOP 20:59
in the actions class that is
oh i can set an @array though. and i gues use that 21:00
jnthn m: grammar G { token TOP { (.)(.) } }; class A { method TOP($/) { say $/.list } }; G.parse('xy', :actions(A)) 21:01
camelia (「x」 「y」)
jnthn m: grammar G { token TOP { <alpha> <digit> } }; class A { method TOP($/) { say $/.hash } }; G.parse('x2', :actions(A))
camelia Map.new((:alpha(Match.new(list => (), made => Any, pos => 1, hash => Map.new(()), orig => "x2", from => 0)),:digit(Match.new(list => (), made => Any, pos => 2, hash => Map.new(()), orig => "x2", from => 1))))
jnthn m: grammar G { token TOP { (.) <digit> } }; class A { method TOP($/) { say $/.caps } }; G.parse('x2', :actions(A)) 21:02
camelia (0 => 「x」 digit => 「2」)
jnthn If one of those isn't what you want I need a little more explaining. :-) 21:02
samcv jnthn, gist.github.com/9c08cbff64bb8b21d1...f9e37536f7
i get nothing but an empty list printing out like this
but printing out $/ itself works fine. gisting that is
caps does work though 21:03
jnthn Ah, yes, because <hex> and friends are named captures
That's what I meant by "Positional captures in .list" 21:04
samcv ah kk
jnthn It'll only give those captured like (xxx)
samcv ok i got it. using caps now :)
jnthn Hm, I'm sure I wrote something to parse that file at some point... :) 21:06
samcv yeah we have something to parse the file right now. i'm making it better though :) but yes you have :) 21:07
going to check individual graphemes instead of just the length of the total graphemes now
jnthn yeah, just ofund it
*found it
github.com/perl6/roast/blob/master...est-gen.p6
:)
samcv to make it fully test what the test is testing
i wrote that one you wrote the one before that :) 21:08
haxmeister json module seems to work
samcv in git history somewhere
jnthn And yeah, I was like "wait, how did I get away with such simple parsing code...oh" :D
samcv yeah neither of us did it very complex
tested it 90% which is mostly good enough
unless you have two incorrect in the wrong direction break/nobreaks
unlikely but. 21:09
important to test for
jnthn Yeah, it's nice to have to make sure we're really getting it right :) 21:09
Especially with Unicode 9 21:10
The world was simpler in Unicode ...
*9
gah, 8 :)
samcv heh
the good ol days
jnthn Yeah, the emoji stuff broke the "just examine two codepoints" assumption :/ 21:11
samcv and prepend 21:21
broke the directional ensurement for state 21:22
maybe didn't use the bset words there
*best
but you get what i mean
i've almost got this :) going to look nice this test 21:23
jnthn samcv++ 21:24
samcv gonna be my best looking one yet
samcv \o/ success 21:46
samcv jnthn, might include the test file in roast maybe? it doesn't take very long to process it using a grammar 21:48
jnthn samcv: As in the Unicode test data file itself? 21:50
samcv yeah
jnthn Guess we can...are there any license condiderations? 21:51
*considerations
samcv i will check into that.
jnthn But otherwise, if it's quick enough just to parse and test each case as it comes then may as well do that
samcv yeah 21:52
just have to make sure to not delete their license information
"this copyright and permission notice appear in associated Documentation." 21:53
so that's fairly simple.
samcv ok so we have 11 lines that result in failures up from 4 22:01
so yay 22:02
yay failure!