Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-11-24

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:02 seatek joined #perl6
00:09 dudz thanks perlawhirl , thought i'd ask
00:11 firstdayonthejob joined #perl6
00:13 pierre_ joined #perl6
00:17 mohae joined #perl6
00:18 sufrostico joined #perl6
00:27 baest joined #perl6
00:32 pierre_ joined #perl6
00:35 raiph joined #perl6
00:42 raiph joined #perl6
01:03 raiph joined #perl6
01:03 firstdayonthejob joined #perl6
01:17 AlexDaniel joined #perl6
01:17 pierre_ joined #perl6
01:35 aborazmeh joined #perl6
01:35 aborazmeh joined #perl6
01:46 seatek if you do a ["a".."z"].pick -- does it allocate the whole range before picking? is pick 1, "a".."z" any different?
01:50 timotimo when you write ["a".."z"], it'll iterate the range to put it into a list, as you requested
01:50 timotimo if you do ("a".."z").pick, it should be better
01:50 seatek :) that's pretty much what i was thinking too
01:55 seatek i can't seem to find any difference between pick and roll
01:56 timotimo yeah, it's only for when you give it a number
01:56 timotimo m: say ("a".."h").pick(10)
01:56 camelia rakudo-moar f928a2: OUTPUT«(c b d f h e a g)␤»
01:56 timotimo m: say ("a".."h").roll(10)
01:56 camelia rakudo-moar f928a2: OUTPUT«(a d c f b d e f b h)␤»
01:56 timotimo m: say ("a".."h").roll(100)
01:56 camelia rakudo-moar f928a2: OUTPUT«(h c d e h e d h a h a f a b e f c d d g d g g b h e g c c e a g c h g h h b b b c c b c a a h e h f f c h g b g a h c a c e a a e c a g f e e b a h g f e a a c g c e d e g g f e a b a f g e a c f d g)␤»
01:56 timotimo m: say ("a".."h").pick(100)
01:56 camelia rakudo-moar f928a2: OUTPUT«(f c h d b g e a)␤»
01:56 timotimo pick is "pick one, don't put it back"
01:56 timotimo roll is "roll it like a dice"
01:57 seatek oh my gosh how subtle and cool :)
01:58 seatek timotimo++ thank you
02:01 japhb timotimo: 'dice' is plural.  :-)
02:02 timotimo oh fuck off and dice, english ;)
02:02 japhb 'die' is the singular.
02:02 japhb Pretty much.
02:10 raiph joined #perl6
02:14 bisectable6 joined #perl6
02:14 committable6 joined #perl6
02:14 evalable6 joined #perl6
02:14 benchable6 joined #perl6
02:15 unicodable6 joined #perl6
02:20 raiph joined #perl6
02:27 kalkin-_ joined #perl6
02:32 pierre_ joined #perl6
02:40 pierre_ joined #perl6
02:40 Unavowed joined #perl6
02:40 labster joined #perl6
02:47 ilbot3 joined #perl6
02:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:49 raiph joined #perl6
02:51 Unavowed joined #perl6
02:54 kyclark_ joined #perl6
02:56 pierre_ joined #perl6
03:04 raiph joined #perl6
03:05 raiph joined #perl6
03:24 shin- joined #perl6
03:27 aborazmeh joined #perl6
03:27 aborazmeh joined #perl6
03:30 noganex joined #perl6
03:31 canopus joined #perl6
03:42 xtreak joined #perl6
03:48 raiph joined #perl6
03:53 shin- m: say 10;
03:53 camelia rakudo-moar f928a2: OUTPUT«10␤»
03:57 labster bisect: old=2016.10 my $errors = 3; my @stuff = flat ("abc" xx 255) Z ("12" xx 128+$errors); for @stuff -> $line { unless $line ~~ m/1/ { say "seen: $line" if $line.index("2") }; if $line ~~ m/9/ { } }
03:57 bisectable6 labster, On both starting points (old=2016.10 new=f928a20) the exit code is 0 and the output is identical as well
03:57 bisectable6 labster, Output on both points:
03:58 labster bisect: my $errors = 3; my @stuff = flat ("abc" xx 255) Z ("12" xx 128+$errors); for @stuff -> $line { unless $line ~~ m/1/ { say "seen: $line" if $line.index("2") }; if $line ~~ m/9/ { } }
03:58 bisectable6 labster, Bisecting by output (old=2015.12 new=f928a20) because on both starting points the exit code is 0
03:58 bisectable6 labster, bisect log: https://gist.github.com/2be3​fc5ee5f1d7ca2db07d886341ceaf
03:58 bisectable6 labster, (2016-08-19) https://github.com/rakudo/rakudo/commit/​25e9fd76e85fabda20e263b6f87e27b0673f26e2
03:58 labster heh, moar bump.
04:07 ZzZombo_ Inline::Perl5 returns wrongly false for ^can calls on P5 objects.
04:08 Guest51424 joined #perl6
04:08 ZzZombo fucking stupid nickserv
04:12 kyclark_ joined #perl6
04:23 pierre_ joined #perl6
04:51 skrshn joined #perl6
05:02 timotimo that feel when rakudo.org is dead
05:02 skrshn hello I am interested in solving the computation of Euler number using Rat lazily - https://gist.github.com/anonymous​/7bc8161c48b12792d38d011c54f43088
05:02 skrshn stuck
05:03 jameslenz joined #perl6
05:04 xiaomiao joined #perl6
05:05 timotimo m: (0...*).map({ 1 / [*]1..$^a }).produce(* + *)[^10].say
05:05 camelia rakudo-moar f928a2: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3(0...*).map({ 1 / [*]7⏏1..$^a }).produce(* + *)[^10].say␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        s…»
05:05 timotimo m: (0...*).map({ 1 / [*] 1..$^a }).produce(* + *)[^10].say
05:05 camelia rakudo-moar f928a2: OUTPUT«(1 2 2.5 2.666667 2.708333 2.716667 2.718056 2.718254 2.718279 2.718282)␤»
05:05 timotimo skrshn: does that look good to you?
05:05 skrshn let me check :-)
05:06 timotimo m: (0...*).map({ 1 / [*] 1..$^a }).produce(* + *)[^10]>>.nude.say
05:06 camelia rakudo-moar f928a2: OUTPUT«((1 1) (2 1) (5 2) (8 3) (65 24) (163 60) (1957 720) (685 252) (109601 40320) (98641 36288))␤»
05:06 skrshn cool I need to look up produce
05:07 skrshn At what point does a Rat get converted to Num?
05:10 gfldex on any sub or method listed as returning Numeric in https://docs.perl6.org/type/Cool
05:10 skids joined #perl6
05:10 timotimo i think when the denominator overflows 64bit
05:10 skrshn timotimo: thanks a lot
05:11 timotimo m: (0...*).map({ FatRat.new(1,1) / [*] 1..$^a }).produce(* + *)[100]>>.nude.say
05:11 camelia rakudo-moar f928a2: OUTPUT«((429977890779876775280119912224203​763466351828078471427513178281334659752387​095672066000822754494999649605775817505090​6671347686438130409774741771022426508339 1581800261761765299689817607733333906622304546853​92578760327057449521355920728670523629599959587…»
05:11 timotimo m: (0...*).map({ 1 / [*] 1..$^a }).produce(* + *)[100]>>.nude.say
05:11 camelia rakudo-moar f928a2: OUTPUT«No such method 'nude' for invocant of type 'Num'␤  in block <unit> at <tmp> line 1␤␤»
05:11 timotimo m: (0...*).map({ 1 / [*] 1..$^a }).produce(* + *).first(Num, :k).say
05:11 camelia rakudo-moar f928a2: OUTPUT«21␤»
05:11 timotimo wow, already at the 21st entry?
05:12 timotimo m: (0...*).map({ 1 / [*] 1..$^a }).produce(* + *)[20].nude.say
05:12 camelia rakudo-moar f928a2: OUTPUT«(6613313319248080001 2432902008176640000)␤»
05:12 Cabanossi joined #perl6
05:13 skrshn :-)
05:14 dalek doc: 156555f | gfldex++ | doc/Type/Rat.pod6:
05:14 synopsebot6 Link: http://doc.perl6.org/type/Rat
05:14 dalek doc: link to FatRat
05:14 dalek doc: review: https://github.com/perl6/doc/commit/156555f3c1
05:14 gfldex m: (0...*).map({ 1.FatRat / [*] 1..$^a }).produce(* + *)[100]>>.nude.say
05:14 camelia rakudo-moar f928a2: OUTPUT«((429977890779876775280119912224203​763466351828078471427513178281334659752387​095672066000822754494999649605775817505090​6671347686438130409774741771022426508339 1581800261761765299689817607733333906622304546853​92578760327057449521355920728670523629599959587…»
05:18 skrshn wow!!
05:20 skrshn It is super fast too
05:20 timotimo perl6 is super slow, though
05:21 timotimo well, not always. sometimes it can be very fast
05:21 skrshn I am scratching the surface one-and-off and am loving it. speed not been an issue for me. maybe for some real problems
05:22 skrshn side question: is there a vim mode for the REPL ?
05:22 timotimo depends entirely on what Linenoise and Radline provide
05:22 timotimo Readline*
05:24 Woodi joined #perl6
05:24 skrshn My environment is (set -o vi) in zsh
05:24 timotimo tbh i have no clue how to configure readline or linenoise
05:24 skrshn But I don't have vim mode in the REPL
05:24 timotimo but you can use rlwrap
05:24 gfldex the REPL comes with it's own problems. You may be better of with teaching vim to run a script with the press of a button.
05:25 timotimo aye, the REPL can cause some really mysterious failures and misbehaviours
05:25 gfldex nmap <F1> :w<CR>:!perl6 -I ./lib %<CR>
05:25 gfldex imap <F1> <esc>:w<CR>:!perl6 -I ./lib %<CR>
05:25 skrshn good suggestion. tx
05:25 timotimo yeah, you never use the F1 key anyway!
05:26 geekosaur readline reads a config file (there's a default and apps can override it) and you can specify vi default in there
05:28 gfldex nmap <F5> :!git commit %<CR>
05:28 gfldex nmap <F6> :!git push<CR>
05:28 gfldex nmap <F7> :!git diff %<CR>
05:28 gfldex PR welcome btw :)
05:35 breinbaas joined #perl6
05:38 raiph joined #perl6
05:39 ZzZombo joined #perl6
05:39 ZzZombo joined #perl6
05:43 ZzZombo So how can I check if a Perl 5 object has a method?
05:43 cdg joined #perl6
05:46 gfldex m: class A {}; class B {}; multi sub infix:<.>(A:D, B:D){ say 'calling B on A' }; A.new.B.new
05:46 camelia rakudo-moar f928a2: OUTPUT«No such method 'B' for invocant of type 'A'␤  in block <unit> at <tmp> line 1␤␤»
05:47 gfldex m: class A {}; class B {}; multi sub infix:<♥>(A:D, B:D){ say 'calling B on A' }; A.new♥B.new
05:47 camelia rakudo-moar f928a2: OUTPUT«calling B on A␤»
05:48 ZzZombo Perl 5
05:48 ZzZombo <ZzZombo_> Inline::Perl5 returns wrongly false for ^can calls on P5 objects.
05:48 gfldex i got that part, still down know the answer
05:48 ZzZombo ^can or can, result is the same.
05:49 gfldex you may want to file a bug report
05:49 timotimo how would you figure it out in perl5?
05:50 ZzZombo if($obj->can("method"))
05:50 gfldex if there is no sane way I would eval
05:50 gfldex so for the time being you can EVAL
05:50 ZzZombo or if I was to call it afterwards
05:50 ZzZombo if(my $m=$obj->can("method")){ $m($obj,@_) }
05:58 ZzZombo Actually, I don't know how an eval would help me. I can't usefully pass the object into the EVAL string, because it will get stringified, and if I escape the sigil, it will be just an unknown identifier for P5 code.
05:58 ZzZombo Won't it?
06:10 pierre_ joined #perl6
06:25 pierre_ joined #perl6
06:28 wamba joined #perl6
06:37 bjz joined #perl6
06:37 darutoko joined #perl6
06:50 RabidGravy joined #perl6
06:51 seatek EVAL!!
06:51 * seatek twitches
06:57 domidumont joined #perl6
07:01 bjz joined #perl6
07:02 cyphase joined #perl6
07:03 domidumont joined #perl6
07:06 labster joined #perl6
07:17 zilti joined #perl6
07:20 raiph joined #perl6
07:26 firstdayonthejob joined #perl6
07:36 gfldex ZzZombo: if the object is stringified you need to do a dynamic lookup to turn the name back into an object. If that is possible in Perl 5 I don't know.
07:45 nine ZzZombo: the Perl5Parent and Perl5Extension roles already have a proper implementation for can. Will just have to copy that to Perl5Package. Until that's done, you can always use the low level interface Inline::Perl5.default_perl5.call_method($obj, 'can');
07:52 nine Actually s/Perl5Package/Perl5Object/ or just put it in both...
07:58 ZzZombo hm, why is Inline::Perl5.default_perl5 available from outside the class? It's declared via 'my'.
07:59 nine There's an accessor method
07:59 ZzZombo ah, must've missed it.
08:00 nine It's mostly there so EVAL 'foo', :lang<Perl5> and use Foo:from<Perl5> find their Inline::Perl5 object, but can be used for other purposes, too.
08:02 ZzZombo nine, so how exactly do I use call_method? Inline::Perl5.default_perl5.call_method($obj, 'can', args)?
08:03 ZzZombo that is, $result=Inline::Perl5.defau​lt_perl5.call_method($obj, 'can', args)
08:03 andrzejku joined #perl6
08:08 timotimo now gcc is just fucking with me
08:09 timotimo https://gist.github.com/timo/fb​d1ccb77a5b067c51ae7117b23f931d  -  you see how it tells me the thing that's in BODY is an MVMArrayBody, but also that i have explicitly put an & before the part where i take the object's body?
08:09 timotimo what is gcc smoking ;_;
08:09 timotimo wait ... is the address of something that's a union just not defined? or something?
08:11 timotimo maybe when i lie down now i can get some sleep? bashing heads against walls tends to do that to people
08:12 ZzZombo yeah, don't bash people's heads, not even if not against walls.
08:14 zilti According to the error you did not put an & before BODY?
08:16 bjz_ joined #perl6
08:19 domidumont joined #perl6
08:23 CIAvash joined #perl6
08:28 ufobat joined #perl6
08:28 wamba joined #perl6
08:34 dakkar joined #perl6
08:38 moritz https://www.reddit.com/r/perl6/comments/5d​sn4a/another_perl_6_book_in_the_works_perl​_6_by_example/?st=ivsk7bqb&amp;sh=e0c612aa a reddit thread with more than 5 comments, and none is negative!
08:39 DrForr *?*
08:40 zakharyas joined #perl6
08:48 moritz crazy stuff, right?
08:49 pierre_ joined #perl6
08:52 Actualeyes joined #perl6
09:02 pierre__ joined #perl6
09:03 rindolf joined #perl6
09:05 ZzZombo is IO::Spec.catfile() similar to File::Spec->catfile()?
09:07 ZzZombo m: say ''.IO.WHAT
09:07 camelia rakudo-moar f928a2: OUTPUT«Must specify something as a path: did you mean '.' for the current directory?␤  in block <unit> at <tmp> line 1␤␤»
09:07 ZzZombo m: say '.'.IO.WHAT
09:07 camelia rakudo-moar f928a2: OUTPUT«(Path)␤»
09:08 ZzZombo not IO::Path?
09:08 ZzZombo m: say './asd'.IO.WHAT
09:08 camelia rakudo-moar f928a2: OUTPUT«(Path)␤»
09:09 ZzZombo m: say './asd'.IO.abspath
09:09 camelia rakudo-moar f928a2: OUTPUT«/home/camelia/asd␤»
09:16 cygx joined #perl6
09:16 cygx o/
09:16 DrForr \o
09:17 cygx timotimo: & has lower precedence than ->, so you need to add parens either when you cann the macro or change BODY->in_situ to (BODY)->in_situ in its definition
09:17 cygx *call
09:17 cygx (...and the keys aren't even close to each other...)
09:19 dalek doc: fe43e2e | ZzZombo++ | doc/Type/IO/Path.pod6:
09:19 synopsebot6 Link: http://doc.perl6.org/type/IO/Path
09:19 dalek doc: Update Path.pod6
09:19 dalek doc: review: https://github.com/perl6/doc/commit/fe43e2ead8
09:20 arnsholt I'd vote for the latter solution
09:20 arnsholt That's good practice when writing macros in C anyways. Always, always, always put parens around macro arguments in the expansion
09:23 ZzZombo why would I want to write 'if $file.IO ~~ :e' instead of 'if 'path/to/file'.IO.e'?
09:24 gfldex m: say '.'.IO.^name
09:24 camelia rakudo-moar f928a2: OUTPUT«IO::Path␤»
09:24 gfldex ZzZombo: .^name will give you the FQN
09:30 cygx ZzZombo: the smartmatch might not be particularly useful when using explicit ~~, but it allows you to use :e in given..when, etc
09:31 vendethiel- joined #perl6
09:32 gfldex m: say so '.'.IO ~~ :e|:d
09:32 camelia rakudo-moar f928a2: OUTPUT«True␤»
09:32 gfldex ZzZombo: ^^^^
09:32 perlawhirl joined #perl6
09:32 ZzZombo IC
09:34 ZzZombo but again, probably in the docs, it's better to stick to the procedural, natural form, and use such intricate syntax only where it's relly needed or useful.
09:36 ZzZombo m: class A { method m { .n}; method n { say 'n' } };A.new.m;
09:36 camelia rakudo-moar f928a2: OUTPUT«No such method 'n' for invocant of type 'Any'␤  in method m at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
09:36 ZzZombo m: class A { method m {n}; method n { say 'n' } };A.new.m;
09:37 camelia rakudo-moar f928a2: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    n used at line 1␤␤»
09:37 ZzZombo m: class A { method m {self.n}; method n { say 'n' } };A.new.m;
09:37 camelia rakudo-moar f928a2: OUTPUT«n␤»
09:37 dalek doc: 671e00e | gfldex++ | doc/Type/IO/Path.pod6:
09:37 synopsebot6 Link: http://doc.perl6.org/type/IO/Path
09:37 dalek doc: improve examples
09:37 dalek doc: review: https://github.com/perl6/doc/commit/671e00e869
09:40 dalek doc: c306960 | ZzZombo++ | doc/Type/IO/Path.pod6:
09:40 synopsebot6 Link: http://doc.perl6.org/type/IO/Path
09:40 dalek doc: Improve this further ;)
09:40 dalek doc: review: https://github.com/perl6/doc/commit/c30696080e
09:45 jonas1 joined #perl6
09:46 ocbtec joined #perl6
09:52 gfldex ZzZombo: i do not agree. If it points to a directory it needs to be a symlink to a dir.
09:52 gfldex I can point at you but I will never be you
09:53 ZzZombo what
09:54 ZzZombo do not mix the path and the physical entry on the disk up.
09:54 ZzZombo the argument you give to IO related functions is path.
09:54 ZzZombo path points to files and directories.
09:54 ZzZombo it can't be any of them.
09:55 gfldex if that is true, why are there no hardlinks to directories (for sane OSes)?
09:57 ZzZombo what are you talking about? I honestly have no idea.
10:00 gfldex from the standpoint of the OS the location on disk/device-id of a dir is it's identity. From the standpoint of the user a path that does not include fancy stuff linke symlinks, reparse-points or bind mounts, provides the identity of a directory. Quite in contrast of a file that may be hardlinked.
10:01 DrForr UNIX ln creates hardlinks by default, it's just that we're so used to typing 'ln -s' that finger memory has helped obliterate knowledge of them...
10:02 gfldex i wrote "sane OSes"
10:03 ZzZombo Man, again, you feed the function a path, a string that points to a file/folder. Whatever that file or folder points to is entirely different story.
10:04 bpmedley joined #perl6
10:04 Actualeyes joined #perl6
10:07 CIAvash joined #perl6
10:07 wamba joined #perl6
10:14 arnsholt Saying that the path object for a directory points to a directory rather than being a directory is needless semantic hairsplitting, IMO
10:15 arnsholt Especially given the existence of symlinks
10:15 arnsholt I'm confused why the example tests agains ":e & :d", though4
10:15 arnsholt Since :d implies :e anyways
10:17 gfldex arnsholt: to show that you can use ~~ with a junction of the colon pair form
10:17 xtt joined #perl6
10:18 sftp joined #perl6
10:18 arnsholt Sure. But in that case, why not something useful like ":f & :r"?
10:19 gfldex good point
10:21 xtreak joined #perl6
10:32 ZzZombo m: die X::IO::DoesNotExist.new(:path("foo/bar"))
10:32 camelia rakudo-moar f928a2: OUTPUT«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 block <unit> at <tmp> line 1␤Failed to find 'foo/bar' while trying to do '.'␤  in block <unit>…»
10:32 ZzZombo m: die X::IO::DoesNotExist.new(:pa​th("foo/bar"),:trying(''))
10:32 camelia rakudo-moar f928a2: OUTPUT«Failed to find 'foo/bar' while trying to do '.'␤  in block <unit> at <tmp> line 1␤␤»
10:32 ZzZombo m: die X::IO::DoesNotExist.new(:path(​"foo/bar"),:trying('trying'))
10:32 camelia rakudo-moar f928a2: OUTPUT«Failed to find 'foo/bar' while trying to do '.trying'␤  in block <unit> at <tmp> line 1␤␤»
10:32 ZzZombo eh
10:33 ZzZombo I don't need that 'trying' thing.
10:36 bjz joined #perl6
10:38 gfldex ZzZombo: you could subclass X::IO::DoesNotExist
10:38 ZzZombo nah, I'm not that badly against it.
10:39 ZzZombo too much effort for that.
10:40 ugjka joined #perl6
10:44 pierre__ joined #perl6
11:18 pierre_ joined #perl6
11:19 mtj_ joined #perl6
11:20 pierre_ joined #perl6
11:27 breinbaas joined #perl6
11:47 rurban joined #perl6
11:52 vendethiel joined #perl6
11:53 kurahaupo joined #perl6
11:54 kurahaupo_ joined #perl6
11:56 xtreak joined #perl6
11:58 ZzZombo m: class A { method m {$.n}; method n { say 'n' } };A.new.m;
11:58 camelia rakudo-moar f928a2: OUTPUT«n␤»
11:58 notostraca joined #perl6
12:11 rindolf joined #perl6
12:14 rurban joined #perl6
12:14 cognominal joined #perl6
12:21 kurahaupo joined #perl6
12:23 kurahaupo joined #perl6
12:33 rindolf joined #perl6
12:38 ugjka joined #perl6
13:03 user9 joined #perl6
13:07 xinming joined #perl6
13:13 xinming joined #perl6
13:37 brrt joined #perl6
13:57 wamba joined #perl6
14:08 AlexDaniel joined #perl6
14:14 rurban joined #perl6
14:15 khw joined #perl6
14:24 ZzZombo so it says I shouldn't use warn() directly, but rather use note(), do I read it correctly?
14:30 timotimo warn goes through the exception mechanism
14:30 timotimo so you can "quietly" it if you want
14:31 ZzZombo m: class A { has $.field='value'; multi method field ($value where defined){ $!value=$value;return self } };say A.new.field('nyan').field;
14:31 camelia rakudo-moar 6e7782: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of bare "defined"; in Perl 6 please use .defined if you meant $_, or use an explicit invocant or argument, or use &defined to refer to the function as a noun␤at <tmp>:1␤------> 3multi me…»
14:31 ZzZombo m: class A { has $.field='value'; multi method field ($value where .defined){ $!value=$value;return self } };say A.new.field('nyan').field;
14:31 camelia rakudo-moar 6e7782: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Attribute $!value not declared in class A␤at <tmp>:1␤------> 3defined){ $!value=$value;return self } }7⏏5;say A.new.field('nyan').field;␤    expecting any of:␤        horizontal whitespace␤  …»
14:31 ZzZombo m: class A { has $.field='value'; multi method field ($value where .defined){ $!field=$value;return self } };say A.new.field('nyan').field;
14:31 camelia rakudo-moar 6e7782: OUTPUT«Cannot resolve caller field(A.new(field => "nyan"): ); none of these signatures match:␤    (A $: $value where { ... }, *%_)␤  in block <unit> at <tmp> line 1␤␤»
14:32 ZzZombo m: class A { has $.field='value'; multi method field ($value){ $!field=$value;return self } };say A.new.field('nyan').field;
14:32 camelia rakudo-moar 6e7782: OUTPUT«Cannot resolve caller field(A: ); none of these signatures match:␤    (A $: $value, *%_)␤  in block <unit> at <tmp> line 1␤␤»
14:33 jnthn You'd need to write a multi to get it also
14:34 jnthn multi method field() { $!field }
14:34 jnthn Or so
14:34 ZzZombo m: class A { has $.field='value'; multi method field (Str:D $value){ $!field=$value;return self } };say A.HOW.methods;
14:34 camelia rakudo-moar 6e7782: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤  in any methods at gen/moar/m-Metamodel.nqp line 494␤  in block <unit> at <tmp> line 1␤␤»
14:35 ZzZombo m: class A { has $.field='value'; multi method field (Str:D $value){ $!field=$value;return self } };say A.HOW.methods(1);
14:35 camelia rakudo-moar 6e7782: OUTPUT«(field)␤»
14:35 ZzZombo m: class A { has $.field='value'; multi method field (Str:D $value){ $!field=$value;return self } };say A.HOW.methods(111);
14:35 camelia rakudo-moar 6e7782: OUTPUT«(field)␤»
14:36 ZzZombo hm
14:36 jnthn Better written A.^methods
14:36 jnthn (which does A.HOW.methods(A))
14:37 ZzZombo m: class A { has $.field='value'; multi method field (Str:D $value){ $!field=$value;return self } };say A.^methods;
14:37 camelia rakudo-moar 6e7782: OUTPUT«(field)␤»
14:37 ilmari[m] joined #perl6
14:37 ZzZombo why is there only one method? Does my declaration make the implicit one go away?
14:37 jnthn Yes
14:38 ZzZombo wel
14:38 ZzZombo l
14:38 jnthn An accessor is only installed for you if there's no method of that name already
14:38 ZzZombo I hoped for them to coexist
14:38 ZzZombo there is no reason for manually writing those trivial getters for all of them.
14:39 tadzik joined #perl6
14:39 M-Illandan joined #perl6
14:39 Matthew[m] joined #perl6
14:39 jnthn There's no reason for writing trivial setters either, just stick "is rw" on things.
14:39 Matias[m] joined #perl6
14:39 dp[m] joined #perl6
14:40 ZzZombo but 1) I don't like a.x=y; 2) I need some logic attached to changing values.
14:40 lucasb_ joined #perl6
14:40 jnthn Well, on 1) can't do much for you; if you're going to fight the language you're going to write more code. Same in any language.
14:41 ZzZombo I'm not fighting at all.
14:41 jnthn On 2 - what logic do you need? If it's validation, just stick there where on the attribute.
14:41 ZzZombo If assigments could do that, I would stick to them pretty much.
14:42 lucasb_ m: say <a b c>[0..*]
14:42 camelia rakudo-moar 6e7782: OUTPUT«(a b c)␤»
14:42 lucasb_ m: say <a b c>[0..*+1]
14:42 camelia rakudo-moar 6e7782: OUTPUT«(a b c Nil Nil)␤»
14:42 ZzZombo what logic? When filename changes, load that file.
14:43 lucasb_ in a range subscript end, it seems like Whatever means both numbers
14:43 lucasb_ for a list of 3 values, * means both 2 and 3 ??? :)
14:43 lucasb_ m: say <a b c>[0..*-1]
14:43 camelia rakudo-moar 6e7782: OUTPUT«(a b c)␤»
14:43 lucasb_ m: say <a b c>[0..*-2]
14:43 camelia rakudo-moar 6e7782: OUTPUT«(a b)␤»
14:44 lucasb_ ^^^ noticed that 0..* and 0..*-1 return the same thing?
14:44 awwaiid ZzZombo: filename changes meaning a field for the filename is modified? If that's the case, a more explicit ".load_file($filename)" method might be more usable ath the invocation point
14:44 lucasb_ can someone clarify this to me?
14:44 masak lucasb_: do you agree that '*' is the big exception here?
14:44 jnthn ZzZombo: I'd probably consider writing a method with a meaningful name for what's going on and having the filename attribute as an internal detail.
14:44 timotimo the thing is that 0..* is the same as 0..Inf
14:45 timotimo whereas when you have 0..*+1 you end up building a WhateverCode that takes the argument passed to it from postcircumfix:<[ ]>
14:45 awwaiid m: say<a b c>[0..(*)]
14:45 camelia rakudo-moar 6e7782: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Use of non-subscript brackets after "say" where postfix is expected; please use whitespace before any arguments␤at <tmp>:1␤------> 3say7⏏5<a b c>[0..(*)]␤    expecting any of:␤        argument …»
14:45 awwaiid m: say<a b c>[0..*+0]
14:45 camelia rakudo-moar 6e7782: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Use of non-subscript brackets after "say" where postfix is expected; please use whitespace before any arguments␤at <tmp>:1␤------> 3say7⏏5<a b c>[0..*+0]␤    expecting any of:␤        argument …»
14:45 timotimo so in one case it finds the end of the list and says "we're done here" (infinite list), in the other you're requesting an actual range
14:45 awwaiid m: say <a b c>[0..*+0]
14:45 camelia rakudo-moar 6e7782: OUTPUT«(a b c Nil)␤»
14:45 timotimo awwaiid: you need to put ( after say
14:45 timotimo or a space
14:45 timotimo yeah
14:45 awwaiid m: say <a b c>[0..(*)]
14:45 camelia rakudo-moar 6e7782: OUTPUT«(a b c)␤»
14:45 awwaiid yeah, wasn't reading the error
14:46 ZzZombo when I was working with XML, I'd created objects corresponding to the structure of the file elements. When you change a field of such object, it modifies corresponding element in the DOM.
14:46 awwaiid m: say <a b c>[0..(*+0)]
14:46 camelia rakudo-moar 6e7782: OUTPUT«(a b c Nil)␤»
14:46 lucasb_ oh! I didn't pay attention to this detail :)
14:46 lucasb_ yes, the 0..(*+0) clarified it perfectly
14:46 lucasb_ thanks masak, timotimo, awwaiid
14:48 kyclark_ joined #perl6
14:50 awwaiid m: &infix:<..>.candidates>>.say # I am dissapointed that this doesn't have an explicit ..Whatever invocation
14:50 camelia rakudo-moar 6e7782: OUTPUT«sub infix:<..> ($min, $max) { #`(Sub+{<anon|47920480>}+{Precedence}|57979744) ... }␤»
14:51 ZzZombo Well, it's a shame the OOP-side of P6 isn't as mature as, say, in Delphi; it puzzles me why it didn't look natural to attach proper accessors to properties to the designers of P6. I expected something like that.
14:51 timotimo um, huh?
14:52 timotimo how do you mean that?
14:53 ZzZombo how I mean?
14:53 AlexDaniel joined #perl6
14:53 ZzZombo excuse me?
14:53 lucasb_ how come?
14:53 timotimo why do you think our accessors aren't "proper"?
14:54 awwaiid they might be deeper than you think
14:54 * AlexDaniel listens carefully
14:56 ZzZombo because I don't see how such an easy task (reload a file on changing filename) makes you to write your setter and also getter that in another situation would be provided by the compiler itself. It's natural to attach such logic to the write accessor in Delphi, w/o some dedicated 'load_file' method.
14:56 moritz then make changing the file name a method, instead of an RW accessor
14:57 timotimo yeah, just change the filename using private access and make it readonly otherwise
14:57 moritz a r/w accessor provides an illusion of transparency that additional logic on writes violates
14:57 moritz which is why the language doesn't optimize for that case
14:58 moritz use the language's strengths, not its weaknesses
14:58 moritz this will make both you and camelia happier
14:59 ZzZombo <timotimo> yeah, just change the filename using private access and make it readonly otherwise
14:59 ZzZombo I don't understand, even tho sounds like a solution, can you explain? If I change it to private, I still won't get an implicit getter, so I will still have to write one myself, won't I?
15:00 timotimo you don't have to change it to private
15:00 timotimo every public attribute has its $!foobar to go along with its $.foobar
15:01 moritz ZzZombo: have a method change-filename($new-name) { logic here; $!filename = $new-name }
15:03 awwaiid How can I get the candidates for a method? I want something like &Range::new.candidates (since looking at the &infix:<..> it redispatches to .new)
15:03 viki ZzZombo: just use a Proxy and stick your logic into STORE
15:05 awwaiid ZzZombo: can you show the Delphi equivalent? I'm interested to see what that looks like
15:05 ZzZombo yes, give me a minute
15:05 viki "Cannot use := to initialize an attribute" well.. fme
15:05 awwaiid coo
15:06 timotimo yeah, you have to return the proxy from an accessor method
15:06 viki timotimo: so there's no way to have a proxy attribute withotu writing accessor manually?>
15:06 moritz m: say Range.^find_method('new').^candidates.perl
15:06 camelia rakudo-moar 1b840f: OUTPUT«No such method 'candidates' for invocant of type 'Perl6::Metamodel::ClassHOW'␤  in block <unit> at <tmp> line 1␤␤»
15:06 viki I wonder if a trait can do it...
15:06 viki m: say Range.^find_method('new').candidates.perl
15:06 moritz m: say Range.^find_method('new').candidates.perl
15:06 camelia rakudo-moar 1b840f: OUTPUT«(method new (Mu $: *%) { #`(Method|64277432) ... }, method new (Mu $: $, *@, *%_) { #`(Method|64277584) ... }, method new (Range $: Range $min, \max, :$excludes-min, :$excludes-max, *%_) { #`(Method|74604384) ... }, method new (Range $: \min, Range $max, :…»
15:06 camelia rakudo-moar 1b840f: OUTPUT«(method new (Mu $: *%) { #`(Method|37645192) ... }, method new (Mu $: $, *@, *%_) { #`(Method|37645344) ... }, method new (Range $: Range $min, \max, :$excludes-min, :$excludes-max, *%_) { #`(Method|47972128) ... }, method new (Range $: \min, Range $max, :…»
15:07 timotimo a trait will surely be able to do it
15:07 moritz awwaiid: ^^
15:07 timotimo if not, there's always slangs
15:07 lucasb_ did anyone took a look at RT #130160 ?
15:07 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=130160
15:07 lucasb_ I was trying to golf it
15:07 viki ZzZombo: right, so figure out how to stick a Proxy into an attribute without a lot of manual work and voila \o/
15:08 awwaiid moritz: thanks!
15:09 lucasb_ m: sub f(@a) { say @a; f(@a[1..*, ()].flat) if @a }; f(<a b c d>)
15:09 camelia rakudo-moar 1b840f: OUTPUT«(a b c d)␤(b c d)␤(c d)␤(d)␤()␤»
15:09 lucasb_ m: sub f(@a) { @a.Bool; @a.elems; say @a; f(@a[1..*, ()].flat) if @a }; f(<a b c d>)
15:09 camelia rakudo-moar 1b840f: OUTPUT«(a b c d)␤(b)␤()␤»
15:09 lucasb_ ^^ that's what I have arrived at
15:10 ZzZombo awwaiid, https://gist.github.com/ZzZombo/​263b43ac18e02e81678c05e1295ce232.
15:11 viki m: my $filename := { my $s; Proxy.new(FETCH => method {$s}, STORE => method ($v) { say "loading stuff from file $v"; $s = $v })}(); $filename = 42; say $filename
15:11 camelia rakudo-moar 1b840f: OUTPUT«loading stuff from file 42␤42␤»
15:11 AlexDaniel well, uh… Proxy… that's probably not the answer he is looking for
15:12 viki AlexDaniel: why not?
15:12 AlexDaniel /o\
15:12 viki Since the winge is that they don't wanna write the basic setter multi
15:12 AlexDaniel ok, well… maybe you are right
15:13 awwaiid ZzZombo: ah cool. so the "write SetFilename" says when you write to the attribute you invoke the method
15:13 ZzZombo yes
15:13 AlexDaniel but I can't imagine anyone using Proxy for real in this case
15:13 AlexDaniel that would be just too complicated for such a simple thing
15:13 viki AlexDaniel: you wouldn't be using it directly. You'd have a trait taking a piece of code that does the setter stuff
15:13 awwaiid I feel like Moose does this
15:13 ZzZombo so later ffile.Filename:='my.stuff' will run ffile.SetFilename('my.stuff')
15:14 viki and the trait would stuff the proxy into the attribute, and it'd be doing fancy stuff on setting and still provide the getter, just like that delphi code
15:15 rindolf joined #perl6
15:15 viki Sounds like a perfect module for ZzZombo to write and release into the Ecosystem ;)
15:15 ZzZombo I would, actually.
15:15 viki Sweet \o/
15:15 ZzZombo But I'm still learning
15:16 ZzZombo don't expect much, eh
15:16 AlexDaniel m: class MyFile { has Str $.filename; method set-filename($f) { #`{ do something here; } $!filename = $f } }; my $x = MyFile.new; $x.set-filename(‘hello’); say $x.filename
15:16 camelia rakudo-moar 1b840f: OUTPUT«hello␤»
15:16 AlexDaniel so again, what's wrong with this?
15:16 viki ZzZombo: you can probably steal a lot of code from these two modules: http://modules.perl6.org/#q=Attr+Lazy
15:16 awwaiid yeah, I think as timotimo said, a new trait (which doesn't have to be in the core) should be able to do this. I think it would look like class Foo { has $.filename :writer<set-file>; method set-file($filename) { ... } }
15:16 awwaiid or something like that
15:16 viki That's not what I was thinking at all...
15:17 viki Or maybe it is
15:17 ZzZombo I don't like decoupling between the property and the accessors in the code.
15:17 timotimo well, that syntax isn't going to work :)
15:17 awwaiid I just don't know the syntax quite right
15:17 awwaiid but throw an 'is' or something in there...
15:18 ZzZombo anyway, I'm gonna sleep, so cya all.
15:18 viki bye
15:18 timotimo seeya!
15:19 awwaiid what would the syntax be for a parameterized trait?
15:19 viki is blahblah(param)
15:20 viki m: my $x is default(42); say $x
15:20 camelia rakudo-moar 1b840f: OUTPUT«42␤»
15:20 viki m: my $x is default{42;}; say $x()
15:20 camelia rakudo-moar 1b840f: OUTPUT«42␤»
15:20 awwaiid so maybe class Foo { has $.filename is writer<set-file>; method set-file($filename) { ... } }
15:21 viki I was thinking of just direct code block... has $.filename is writer{ load $filename } or whatever
15:22 awwaiid naw, that'll get out of hand
15:22 awwaiid oh, just to invoke the method
15:22 awwaiid should be able to do both :)
15:22 timotimo if you have a code block, you probably use "will" instead of "is"
15:23 AlexDaniel this is kinda relevant: http://stackoverflow.com/a/31684147/2698019
15:23 AlexDaniel (using Proxy just like Zoffix suggested)
15:32 canopus joined #perl6
15:33 lucasb_ m: -> @a { say @a }.( <a b c>[0..2, ()].flat )
15:33 camelia rakudo-moar 1b840f: OUTPUT«(a b c)␤»
15:34 lucasb_ m: -> @a { @a.Bool; @a.elems; say @a }.( <a b c>[0..2, ()].flat )
15:34 camelia rakudo-moar 1b840f: OUTPUT«(a)␤»
15:34 lucasb_ ^^ a cleaner golf
15:34 lucasb_ so, just calling @a.Bool; @a.elems before printing @a changes the result
15:35 MasterDuke lucasb_: does it need @a.Bool and @a.elems?
15:36 lucasb_ MasterDuke: I only arrived at this result using both .Bool and .elems in that order
15:36 lucasb_ but it can be changed to other equivalents like 'if @a {...}' or @a.Num
15:37 lucasb_ m: -> @a { @a.Bool; @a.elems; say @a }.( <a b c>[1..2, 1..2].flat )
15:37 camelia rakudo-moar 1b840f: OUTPUT«(b b c)␤»
15:37 lucasb_ m: -> @a { my @b = @a; @a.Bool; @a.elems; say @a }.( <a b c>[1..2, 1..2].flat )
15:37 camelia rakudo-moar 1b840f: OUTPUT«(b c b c)␤»
15:47 wamba joined #perl6
15:59 FROGGS joined #perl6
16:00 FROGGS o/
16:00 viki \o\
16:01 DrForr o/ \o/ /X\ _X_ Heeey Macarena
16:01 girafe joined #perl6
16:02 viki Hm... this buggy keyboard driver is a fairy solid evidence of when I'
16:02 viki m using work computer to slack off...
16:02 viki DrForr: what's this macarena stuff?
16:02 timotimo it's a dance that goes with a song
16:02 viki A dance to apease Macaroni God? >:)
16:03 DrForr Sigh, one moment.
16:04 DrForr https://youtu.be/x87B1pjR3H0?t=19
16:05 viki Oh god... I'm bleeding from my ear canals...
16:05 DrForr Eventually I'll figure out how to do it in all precomposed glyphs.
16:05 DrForr Oh, my musical tastes are *much* more depraved, I can assure you.
16:05 * viki cues https://www.youtube.com/watch?v=-9Ls1jWX-TM as a cure
16:07 DrForr It's also at least a whole step up from where I remember it. (Doing ear training at home in spare time...)
16:08 MasterDuke viki: changing topics completely, weren't you musing about !== a little while ago? you were expecting it to be  auto-generated from '!' and '=='? i thought that was interesting, because i would assume it's !(a === b), same at != is !(a == b)
16:08 timotimo viki: huh, that's not The Cure!
16:08 * DrForr locks the taskbar.
16:10 viki ;lkuibn' vWER KU BVRYTESA.Lv. buSAK,RTDEAVS D,.FBTHJMV BLS.ADUT,EN'; BSDRTF/I.LN ASRDF./IKL
16:11 viki That's me headdesking due to users...
16:13 viki TWO people tell me description is missing from product on the website and they think that 'causes the problem of viewing the product via a thingie we have. I reply no, that won't fix it and the problem is with the thingie, BUT I added description anyway and here's the LINK TO THE PRODUCT.... Both of them tell me it isn't showing up, and I tell them to clear cache, they say it's still not there, so I tell them
16:14 viki send me screenshots, and turns out... **drum roll** they were using that thingie to access the website instead of my link, because they thought adding the description fixed the thingie even though I told them it won't
16:14 viki *rage*
16:14 DrForr https://www.youtube.com/watch?v=3avaYymFHrE
16:15 rurban joined #perl6
16:15 timotimo DrForr: you think that's depraved? :)
16:15 zacts joined #perl6
16:16 * timotimo is not sure what to pull out of his arsenal to counter
16:16 viki MasterDuke: oh, I kinda didn't thik we had != for some reason.
16:16 viki s: &infix:<!=>
16:16 SourceBaby viki, Sauce is at https://github.com/rakudo/rakudo/bl​ob/1b840f1/src/core/Numeric.pm#L270
16:16 viki s: &infix:<!==>
16:16 SourceBaby viki, Sauce is at https://github.com/rakudo/rakudo/bl​ob/1b840f1/src/core/metaops.pm#L13
16:16 DrForr Oh, no, I start at https://www.youtube.com/watch?v=c4TZfEOWwW4 and go into weird areas from there.
16:16 viki s: &infix:<!===>
16:16 SourceBaby viki, Sauce is at https://github.com/rakudo/rakudo/bl​ob/1b840f1/src/core/metaops.pm#L13
16:17 viki nqp: nqp::say(2 != 2)
16:17 camelia nqp-moarvm: OUTPUT«0␤»
16:17 viki nqp: nqp::say(2 !== 2)
16:17 camelia nqp-moarvm: OUTPUT«Missing required term after infix at line 2, near " 2)"␤   at gen/moar/stage2/NQPHLL.nqp:625  (/home/camelia/rakudo-m-inst-2/sh​are/nqp/lib/NQPHLL.moarvm:panic)␤ from gen/moar/stage2/NQPHLL.nqp:791  (/home/camelia/rakudo-m-inst-2/s​hare/nqp/lib/NQPHLL.moarvm:EXP…»
16:17 * viki shrugs
16:17 viki MasterDuke: well, the !== is == with ! as a metaop, while != is a proper op.
16:17 viki s: &infix:<!!==>
16:17 SourceBaby viki, Something's wrong: â�¤ERR: [31m===[0mSORRY![31m===[0m Error while compiling -eâ�¤Undeclared routine:â�¤    infix:<!!==> used at line 6. Did you mean 'infix:<∖>', 'infix:<lt>', 'infix:<eq>', 'infix:<o>', 'infix:<~|>'?â�¤â�¤
16:18 timotimo i must admit that video is well made
16:18 viki But that said... if SourceBaby can recognize it, wtf cmp-ok can't :/
16:19 viki m: say &CALLERS::("infix:<!==>")
16:19 camelia rakudo-moar 1b840f: OUTPUT«No such symbol '&infix:<!==>'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
16:19 viki m: say &CALLERS::("infix:<Z>")
16:19 camelia rakudo-moar 1b840f: OUTPUT«sub infix:<Z> (| is raw) { #`(Sub+{<anon|44843824>}+{Precedence}|57430480) ... }␤»
16:19 viki m: say &CALLERS::("infix:<ZZZ>")
16:19 camelia rakudo-moar 1b840f: OUTPUT«No such symbol '&infix:<ZZZ>'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
16:19 viki Oh, OK, it doesn't generate it *there*
16:20 viki s: &infix:<ZZZ>
16:20 SourceBaby viki, Sauce is at https://github.com/rakudo/rakudo/bl​ob/1b840f1/src/core/metaops.pm#L78
16:21 ufobat joined #perl6
16:25 timotimo DrForr: the "lock the taskbar" song is growing on me slowly
16:26 timotimo DrForr: https://www.youtube.com/watch?v=MxA0QVGVEJw - have you come across the axolotl song yet? :)
16:26 DrForr yes.
16:26 DrForr I blame QI :)
16:26 * [Coke] waves from the highway, wishing everyone a happy US thanksgiving.
16:27 timotimo oh, was it featured on television?
16:27 [Coke] ... and in return, just hit dead stop traffic. *angry hand wave*
16:28 timotimo don't irc and drive :)
16:28 DrForr If he's in LA it's a moot point.
16:29 moritz you can totally do that from the co-driver's seat :-)
16:29 timotimo right
16:29 moritz at least outside the US, we sometimes have more than one person in a car, strange as it sounds :D
16:30 viki But then... you aren't *driving*
16:30 moritz viki: [Coke] didn't say he was
16:31 * PerlJam hopes Coke didn't *actually* hit traffic
16:32 PerlJam Happy Turkey Day everybody!
16:32 viki But it already happened, in October!
16:33 PerlJam m: my @n = ^10;  @n <<*=>> 2; dd @n;
16:33 camelia rakudo-moar 1b840f: OUTPUT«Array @n = [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]␤»
16:33 PerlJam m: my @n = ^10;  @n <<=>> 5; dd @n;
16:33 camelia rakudo-moar 1b840f: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing << or >>␤at <tmp>:1␤------> 3my @n = ^10;  @n <<=>7⏏5> 5; dd @n;␤    expecting any of:␤        infix␤        infix stopper␤»
16:33 PerlJam It's weird that the first one works but the other does not
16:34 moritz ah
16:34 moritz it tries to aprse it as << => >>
16:34 viki m: my @n = ^10;  @n <<[=]>> 5; dd @n;
16:34 camelia rakudo-moar 1b840f: OUTPUT«Array @n = [5, 5, 5, 5, 5, 5, 5, 5, 5, 5]␤»
16:34 moritz parse
16:35 moritz because => is a longer token than =
16:35 viki m: my @n = ^10;  @n «=» 5; dd @n;
16:35 camelia rakudo-moar 1b840f: OUTPUT«Array @n = [5, 5, 5, 5, 5, 5, 5, 5, 5, 5]␤»
16:36 rurban joined #perl6
16:38 PerlJam and that's why I've taken to using « and » as often as I can.
16:38 PerlJam (though I only noticed the <<=>> weirdness because I'm on a keyboard where I don't readily know how to generate « and » except in vi and I wasn't in vi when I was typing stuff)
16:43 rurban left #perl6
16:43 captain-adequate joined #perl6
16:44 * japhb scans the backlog idly, sees people trying to compete over most depraved youtube video, and decides to just back away slowly
16:45 viki Mine wasn't depraved.
16:51 cognominal joined #perl6
16:52 BenGoldberg joined #perl6
17:02 kaare_ joined #perl6
17:13 b2gills joined #perl6
17:16 kyclark_ joined #perl6
17:22 wamba joined #perl6
17:26 wisti joined #perl6
17:35 vendethiel joined #perl6
17:35 perlawhirl joined #perl6
17:37 eisen74 joined #perl6
17:40 perlawhirl joined #perl6
17:45 skids joined #perl6
17:45 cdg joined #perl6
17:51 * viki is starting to see the light at the end of the tunnel of RT#130160
17:53 viki Ah, yes...
17:53 viki *snif* *snif*
17:54 viki That distinct scent of a bug... Yummy
17:57 AlexDaniel SourceBaby: source
17:57 SourceBaby AlexDaniel, See: https://github.com/zoffixznet/perl6-sourceable
18:05 viki w00t, totaly found it \o/
18:07 domidumont joined #perl6
18:11 lucasb_ joined #perl6
18:16 viki lucasb_: I found the cause of the bug you were wondering about today, the flat one
18:17 lucasb_ viki: are fixing it already? :)
18:17 lucasb_ *are you
18:17 Tonik joined #perl6
18:17 viki lucasb_: yeah, I already got Fix#1, which deletes 18 lines and adds zero :)
18:17 viki I wanna see the performance hit of that and if it's bad, then  I got Fix#2
18:18 timotimo so we had a performance optimization that was doing things wrong?
18:18 lucasb_ viki: delete everything :) Perfection is achieved when there is nothing left to take away
18:20 viki timotimo: I looked at git blame briefly and it doesn't look like this was added for performance reasons, I think it may be a leftover from before we made the default impl. in a role
18:20 viki it really just saves a single method call
18:21 viki heh. BEFORE: 32.4776000, AFTER: 32.4663461
18:21 * viki does a couple more runs
18:23 timotimo wow that's bad
18:23 viki What do you mean bad? It got faster!
18:24 timotimo oh, you are right
18:24 timotimo i got it in reverse
18:25 viki m: say "{3.1404537725 / 3.140447684}x faster"
18:25 camelia rakudo-moar 1b840f: OUTPUT«1.0000019387x faster␤»
18:26 timotimo fantastic
18:26 viki no diff basically
18:26 viki umm
18:26 viki MasterDuke: "Makefile:101: recipe for target 'spectest_update' failed"
18:26 DrForr And it's still almost pi seconds.
18:27 viki and Makefile:523: recipe for target 'm-stresstest5' failed
18:28 * viki tries blowing everything up and cloning from scratch
18:29 viki heh, rm -fr rakudo took like 12 seconds to run... All those precomp files :)
18:29 viki bah
18:30 viki That had my unpushed test for one of Zeframs tickets!
18:30 timotimo ah!
18:30 timotimo oh :(
18:30 timotimo they are lost now?
18:31 viki Yup :)
18:33 nnunley joined #perl6
18:34 labster joined #perl6
18:34 viki MasterDuke: nevermind, nuking and recloning the repo fixed that issue
18:40 AlexDaniel m: sleep 9999999999999999999; say ‘awww, that was some good sleep!’
18:40 camelia rakudo-moar 1b840f: OUTPUT«awww, that was some good sleep!␤»
18:40 AlexDaniel commit: all sleep 9999999999999999999; say ‘awww, that was some good sleep!’
18:40 viki heh
18:40 viki :|
18:40 committable6 AlexDaniel, https://gist.github.com/c368​3e0a915db9918dd1b126277528c8
18:41 AlexDaniel I keep forgetting that old versions did not support ‘’
18:41 viki Oh, for a second I thought using an `all` junction made it work all of sudden :D
18:41 AlexDaniel :)
18:41 AlexDaniel anyway, I'll submit a bug report, I guess
18:41 AlexDaniel though people are probably still annoyed by my 9999 bug reports
18:41 viki yeah
18:42 AlexDaniel yeah? yeah…
18:42 viki I dunno, I recall when I was annoyed with Zefram's bug reports of these weird edge cases, but now I'm actually looking forward to them :)
18:42 AlexDaniel :)
18:42 viki yeah as in "yeah, submit it" :)
18:42 hankache joined #perl6
18:43 AlexDaniel STILL NO CREATE NEW TICKET BUTTON!!! AAAAAAAAAAAA
18:47 AlexDaniel aww, too bad there was a ticket between #130168 #130170 :)
18:47 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=130168
18:47 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=130170
18:53 jdukart joined #perl6
18:53 jdukart left #perl6
18:56 AlexDaniel m: say now + Inf
18:56 camelia rakudo-moar 1b840f: OUTPUT«Type check failed in binding to nu; expected Int but got Num (Inf)␤  in block <unit> at <tmp> line 1␤␤»
18:56 AlexDaniel yea, nu
18:58 viki I think there's a ticket for that already
18:58 viki Or at least for the cause of that error
18:58 wamba joined #perl6
18:59 viki Something about Inf being a Rational but not fitting into Rat? or Num? something or other, so it slips past type restriction but can't be used as that type
19:00 AlexDaniel hmmm?
19:02 viki Well, don't see that ticket now, but I know I was the creator and lizmat commented on it that the offending behaviour was added on purpose to make Inf.Num.Something roundtrip
19:03 geekosaur I suspect it fits into a Rat (1/0) and something assumes that anything that can be a Rat can be converted to an Int, but you can't represent infinity as an Int
19:03 viki m: my Rat $ = Inf.Rat
19:03 camelia rakudo-moar 1b840f: OUTPUT«Type check failed in assignment; expected Rat but got Rational[Num,Int] (?)␤  in block <unit> at <tmp> line 1␤␤»
19:03 geekosaur o.O
19:04 viki Ah, here: https://rt.perl.org/Ticket/Displ​ay.html?id=128857#ticket-history
19:04 AlexDaniel no such ticket with Inf in the title
19:04 AlexDaniel ah… dammit
19:04 geekosaur ok, I guess thats one way to roundtrip it. pretty unfortunate way, but then representing something as a division by 0 is also pretty unfortunate
19:04 viki 'casuse I used ∞ :D
19:04 geekosaur edge cases are so much "fun"
19:05 AlexDaniel YAY! Edge case party!
19:06 vendethiel- joined #perl6
19:07 arnsholt Representing infinity as x/0 would be pretty unfortunate, seeing how it's not quite correct and all
19:08 arnsholt m: say Inf.Rat.nude # I wonder
19:08 camelia rakudo-moar 1b840f: OUTPUT«(Inf 0)␤»
19:08 viki m: say NaN.Rat.nude
19:08 camelia rakudo-moar 1b840f: OUTPUT«(NaN 0)␤»
19:09 AlexDaniel ∞/0 ? Really? :-/
19:10 arnsholt Yeah. That's in some way even more unfortunate
19:10 geekosaur looks to me like it just shoves the original in the numerator (which is why it ends up being Rational[Num,Int]) and use the denominator as a flag for it
19:10 AlexDaniel /o\
19:10 geekosaur er, uses denom==0
19:10 AlexDaniel cancel the party, I am out
19:10 viki m: Inf.Rat.base(10).say
19:10 camelia rakudo-moar 1b840f: OUTPUT«P6opaque: get_boxed_ref could not unbox for the representation '20' of type Num␤  in block <unit> at <tmp> line 1␤␤»
19:10 AlexDaniel /o\
19:11 viki m: Inf.Rat.perl.say
19:11 camelia rakudo-moar 61a18c: OUTPUT«P6opaque: get_boxed_ref could not unbox for the representation '20' of type Num␤  in block <unit> at <tmp> line 1␤␤»
19:11 viki (.perl uses .base)
19:11 arnsholt geekosaur: Yeah, that sounds plausible
19:11 eisen74 Is there a simple way to instatiate an array of a determined size using a declaritive statement or is a for loop?
19:12 viki eisen74: is it always gonna be that size?
19:12 eisen74 In this case yes, size of array is known in advance.
19:12 viki eisen74: my @a[42]; if yes, my @a = 0 xx 42; if no
19:12 viki well
19:13 viki eisen74: then the first one will do, that's a shaped array
19:13 viki m: my @a; @a[^42]; dd @a
19:13 camelia rakudo-moar 61a18c: OUTPUT«Array @a = []␤»
19:13 eisen74 It's actual an array or arrays (matrix)
19:13 viki m: my @a; @a[^42] = (); dd @a
19:13 camelia rakudo-moar 61a18c: OUTPUT«Array @a = [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, Any, Any, Any, Any]␤»
19:13 AlexDaniel m: my @a[25] = ($_ for ^25); say @a
19:13 camelia rakudo-moar 61a18c: OUTPUT«[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24]␤»
19:13 viki And that would be the way for unshaed arrays
19:13 viki eisen74: @a[42;72]; (first and second dimension sizes)
19:13 viki m: my @a[3;4]; dd @a
19:13 camelia rakudo-moar 61a18c: OUTPUT«Array.new(:shape(3, 4), [Any, Any, Any, Any], [Any, Any, Any, Any], [Any, Any, Any, Any])␤»
19:14 viki m: my @a[3;4]; a[2;^4] = 42 xx 4; dd @a
19:14 camelia rakudo-moar 61a18c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    a used at line 1␤␤»
19:14 viki m: my @a[3;4]; @a[2;^4] = 42 xx 4; dd @a
19:14 camelia rakudo-moar 61a18c: OUTPUT«Partially dimensioned views of arrays not yet implemented. Sorry. ␤  in block <unit> at <tmp> line 1␤␤»
19:15 viki m: my @a[3;4]; @a[2;|^4] = 42 xx 4; dd @a
19:15 camelia rakudo-moar 61a18c: OUTPUT«Cannot resolve caller AT-POS(Any: Int, Int, Int); none of these signatures match:␤    (Any:U \SELF: int \pos, *%_)␤    (Any:U \SELF: Int:D \pos, *%_)␤    (Any:U $: Num:D \pos, *%_)␤    (Any:U $: Any:D \pos, *%_)␤    (Any:D $: int \pos, *%_)␤   …»
19:15 viki eisen74: it's worth noting those are a fairly new feature so you may come across rough edges :}
19:15 viki m: my @a[3;4]; @a[2;0..3] = 42 xx 4; dd @a
19:15 camelia rakudo-moar 61a18c: OUTPUT«Partially dimensioned views of arrays not yet implemented. Sorry. ␤  in block <unit> at <tmp> line 1␤␤»
19:15 eisen74 Oh wow! That's a neat feature.
19:16 andrzejku joined #perl6
19:16 viki Well, I don't get what it means by partially dimensioned... I guess slices aren't yet implemented on shaped arrays
19:16 viki m: my @a[3;4]; @a[2;0] = 42; dd @a
19:16 camelia rakudo-moar 61a18c: OUTPUT«Array.new(:shape(3, 4), [Any, Any, Any, Any], [Any, Any, Any, Any], [42, Any, Any, Any])␤»
19:16 viki huzzaa
19:17 andrzejku hello gentelmens
19:18 viki Only gentelmens? :) No gals or robots?
19:18 viki We have a sizable population of both :)
19:19 andrzejku sure
19:19 viki andrzejku: how's your quest on starting Perlmongers group going?
19:19 * AlexDaniel changes “shit error message” to “bad error message” in the title of the next bug report
19:19 moritz hello gentlebots :-)
19:19 andrzejku viki, I will meet with my friends on december
19:19 viki \o/
19:20 viki Awesome
19:20 andrzejku however I am not sure if they like perl :D
19:20 AlexDaniel make them
19:20 andrzejku but we will enjoy together
19:20 andrzejku =)
19:20 andrzejku AlexDaniel, that's not easy
19:20 andrzejku to be true I found Ruby as better than perl last time
19:21 AlexDaniel 5 or 6?
19:21 viki heh
19:21 andrzejku Perl5
19:21 andrzejku Perl 6 should be a powerful future I suppose
19:22 andrzejku but I still need share my time with current job which I do mostly in C++
19:24 andrzejku not easy x)
19:25 RabidGravy joined #perl6
19:26 eisen74 thanks viki, camelia.
19:28 xinming joined #perl6
19:28 eisen74 So the multi-dimentional array initialization shorthand is not work looks like. Next best way to init one with a default value?
19:29 domidumont joined #perl6
19:29 AlexDaniel eisen74: what do you mean?
19:29 AlexDaniel m: my @a[2;3] = (25,30,35), (2,3,4); say @a
19:29 camelia rakudo-moar 61a18c: OUTPUT«[[25 30 35] [2 3 4]]␤»
19:30 AlexDaniel m: my @a[2;3] = 1 xx 3 xx 2; say @a
19:30 camelia rakudo-moar 61a18c: OUTPUT«[[1 1 1] [1 1 1]]␤»
19:30 eisen74 yes, camelia, AlexDaniel, that's what I was looking for.
19:30 viki eisen74: it works fine, it's assignment to a slice that wasn't working above.
19:30 eisen74 !!Thx
19:30 eisen74 ok got it.
19:31 nwc10 joined #perl6
19:31 nwc10 I'd just like to say
19:31 nwc10 m: Inf.Rat.perl
19:31 camelia rakudo-moar 61a18c: OUTPUT«P6opaque: get_boxed_ref could not unbox for the representation '20' of type Num␤  in block <unit> at <tmp> line 1␤␤»
19:31 nwc10 that is an awesome bug :-)
19:32 viki it's just trying to put a Num into a native int inside .base
19:33 lizmat I'm open to suggestions to fix this mess  :-)
19:33 lizmat also: please fix the fact that the min/max value of Int isn't an Int  :-)
19:33 viki m: Int.max.say
19:33 camelia rakudo-moar 61a18c: OUTPUT«-Inf␤»
19:33 lizmat m: dd Int.Range
19:33 camelia rakudo-moar 61a18c: OUTPUT«(-Inf, -Inf, -Inf, -Inf, -Inf, -Inf, -Inf, -Inf, -Inf, -Inf... (lazy list)␤»
19:33 viki hah
19:33 lizmat m: say Int.Range
19:33 camelia rakudo-moar 61a18c: OUTPUT«-Inf^..^Inf␤»
19:34 lizmat m: say Int.Range.min.WHAT
19:34 camelia rakudo-moar 61a18c: OUTPUT«(Num)␤»
19:34 AlexDaniel and also let's have Int accept infinity, hehehe…
19:34 AlexDaniel one of those great ancient ideas
19:34 * viki doesn't have any ideas for fixing this mess
19:35 AlexDaniel lizmat: well, the point of #130171 is to just fix the error message somehow
19:35 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=130171
19:35 * geekosaur can't think of any that won't make other things worse (every DWIM has a WAT and this area's chock full of both)
19:35 viki yeah
19:35 nwc10 this is also a bug?
19:35 nwc10 m: say Inf.Rat*0
19:35 camelia rakudo-moar 61a18c: OUTPUT«Type check failed in binding to nu; expected Int but got Num (NaN)␤  in block <unit> at <tmp> line 1␤␤»
19:36 viki nwc10: that's the same cause
19:36 nwc10 OK. I'll add that to the ticket unless someone else has already
19:37 viki nwc10: there're a couple of related tickets: https://rt.perl.org/Ticket/Displ​ay.html?id=127341#ticket-history and https://rt.perl.org/Ticket/Displ​ay.html?id=128857#ticket-history
19:38 labster joined #perl6
19:38 viki And this is the commit that explains what problem we solved by the current situation: https://github.com/rakudo/rakudo/commit/​498d0a4ae4572a84f80c0c572632e12017d779f3
19:38 viki So any new solutions should solve that problem too.
19:39 nwc10 OK
19:39 lizmat sometimes I wonder if we should have an IntNum allomorph
19:40 viki Intersting.
19:40 geekosaur possibly, but I can see that causing other problems too. (like that Int.Range issue is likely to develop weird edge cases)
19:42 viki m: class IntNum is Num is Int {}; my IntNum $x .= new: Inf; say $x; say $x ~~ Int
19:42 camelia rakudo-moar 61a18c: OUTPUT«Inf␤True␤»
19:42 viki hehe
19:42 viki m: class IntNum is Num is Int {}; my IntNum $x .= new: Inf; say $x; say $x ~~ Int; say now + $x
19:42 camelia rakudo-moar 61a18c: OUTPUT«Inf␤True␤Attempt to divide by zero using div␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
19:47 domidumont joined #perl6
19:48 AlexDaniel and then also IntNumStr
19:57 nwc10 left #perl6
20:00 andrzejku do you think that one day one guy will write something like RoR for Perl6
20:00 andrzejku and he will make a boom
20:00 timotimo *shrug*
20:01 timotimo perl6 certainly has bad performance like ruby did back then
20:01 timotimo :P
20:01 andrzejku ruby had bad performance too
20:01 timotimo that's what i'm saying
20:01 vendethiel- "back then" :P
20:02 timotimo it must be important for the success of the thing
20:02 andrzejku however I think moat vm should be rewritten to c++ without nqp to achieve better performance when the API will be consistence
20:02 vendethiel Oo
20:03 vendethiel .oO( goatvm needs no yakshaving; at least )
20:03 andrzejku right now C got worse performance than C++
20:03 vendethiel that's a pretty meaningless statement :)
20:03 tbrowder ref rakudo star: after fooling with it for two days, i give up.  going to  try straight rakudo with a separate module install script.
20:03 timotimo it sounds like you're confused
20:05 viki andrzejku: doubt there will be any booms from RoR-like product. If there's one thing the world needs less now is a yet another web dev framework that is the same as all the rest.
20:06 timotimo viki: it's not about a web framework
20:06 viki andrzejku: besides, wasn't RoR dying or dead because they designed themselves into a corner?
20:06 timotimo it's just "any killer app"
20:06 andrzejku mhmm
20:07 viki Perl 6 is the killer app :)
20:07 andrzejku viki, ruby is not dying, I met with some strange statistics on Tiobe about Ruby but as open source GitHub projects they are a lot and more more
20:08 Ven joined #perl6
20:08 viki andrzejku: that's 'cause TIOBE is crap :)
20:08 andrzejku right now Javascript and NodeJS is winning among developers
20:08 viki andrzejku: and I've said RoR, not Ruby
20:08 vendethiel viki: RoR is doing just fine
20:08 andrzejku viki, I am not web specialist
20:09 vendethiel it's been a corner for 10years now
20:09 viki andrzejku: but they *aren't*. They're just oft-used because Javascript is the only thing you can reliably run on clientside in browsers.
20:09 andrzejku but I think Javascript must be fucked
20:09 viki vendethiel: well, I'm just quoting what chief architect of another web framework said and I heard another guy point out that no one uses RoR so *shrug*
20:09 viki andrzejku: what does that mean?
20:09 andrzejku by adding to web engine perl/ruby interpreters
20:10 vendethiel viki: very surprising that a guy would talk smack about a competitor heh :)
20:10 viki andrzejku: haha. which web engine? :D
20:10 viki vendethiel: the smack talking guy wasn't the competitor.
20:10 andrzejku WebKit or something
20:10 viki andrzejku: and what about others?
20:10 andrzejku I don't care
20:11 RabidGravy I'm confused now
20:11 andrzejku if some companies told users to use Explorer
20:11 moritz from looking at job postings, my impression is that quite many commercial applications are still on Java, many other on RoR, PHP and a few newer ones on pure JS stacks
20:11 viki andrzejku: no real website will use Perloscript for their website if it doesn't work in half the browsers
20:11 timotimo JS is already bad enough in browsers :)
20:12 viki andrzejku: on one of our main websites, I still worry that a user with IE8 will show up, because I know $boss will make me fix the issue... And that browser has been deprectated by its developer and receives no security updates!
20:12 viki The "I don't care" philosophy with Web only if you're running a personal website about nerdy stuff
20:13 andrzejku viki, that's not true
20:13 viki s/only/works only/;
20:13 moritz or you have a very hip audience
20:13 moritz but much serious business doesn't
20:13 andrzejku viki, if you say we got best website with best performance you can say the users use firefox and fuck rest
20:13 andrzejku and they will do that, guess why?
20:13 viki andrzejku: if your website is broken in my browser, I have no means to become your customer.
20:14 viki andrzejku: what's "firefox"?
20:14 moritz andrzejku: many users out there don't even know what a browser is
20:14 andrzejku because they don't care what a shitty browser they will use
20:14 viki Man, the "average user" doesn't know wtf a browser is..
20:14 bstamour joined #perl6
20:14 andrzejku they just want to got your app working everywhere
20:14 viki andrzejku: what app? They don't know who I am, because when the chance for them to find out came, my website was broken in their browser
20:15 andrzejku so you come on your website and there will be message use these browsers to be in power
20:15 andrzejku and they do it
20:15 moritz andrzejku: you seem to argue from a very privileged perspective that many of us can't afford
20:15 ven .oO( As always, the best move is not to code )
20:15 moritz most businesses don't have "the best", and everybody is desparate to use their thing
20:16 viki andrzejku: 99% of users in my office won't be able to install any of those browsers. They would get permission denied from their user accouint settings
20:16 moritz on average, most of them are average
20:16 RabidGravy I thought the days of "best enjoyed with ,,,, browser" were passed
20:16 viki andrzejku: and at least half of them will think your site is trying to get them to install a virus
20:17 andrzejku ;-) I also work in office and most of ppl do what someone told them to do
20:18 andrzejku they will not think it is a virus
20:18 viki And I can install a brower, but I'd just go to a different website. I like *my* browser. I don't care that you're too inept to make your site work in it.
20:18 viki Because there's a competitor that makes me do less work, so I'll go to them.
20:19 viki andrzejku: so your office has unrestricted accounts?
20:19 andrzejku viki, sure
20:19 viki Sounds like a nightmare for I.T. department
20:19 andrzejku viki, but I use linux
20:20 andrzejku viki, linux is illegal there and it is out of restriction however most of tricky problems I need resolve alone or with linux office budies
20:20 andrzejku viki, moreover you can be true about competitors and favourite browsers, but I believe that the world belongs to the bravest
20:21 * andrzejku let the perl make great again
20:22 Ven joined #perl6
20:22 viki That's just an empty saying with no reality to it.
20:23 andrzejku moritz, let the germany make great again :P
20:23 viki I meant the brave thing.
20:23 andrzejku :)
20:24 viki There's nothing brave about forking a browser engine and implementing language XYZ in it. In fact, I'm sure there are hundreds of those. Dead and unloved.
20:25 viki In fact, now I recall there was one that can run Perl 5 client side.
20:25 andrzejku viki, gimme the source
20:25 viki I saw it mentioned on r/perl, but that was ages ago
20:25 dudz but from a marketing view buzzwords like brave and best are profit :)
20:25 RabidGravy activeperl will run in IE ActiveX scripting host
20:25 dudz *hello
20:26 viki And it kinda proves my point: I know that browser exists, but I can't even find it! :)
20:26 RabidGravy or whatever they call it now
20:26 viki dudz: Courage!
20:26 lucasb_ viki++ thanks for fixing the .flat bug
20:26 viki lucasb_++ thanks for golfing it
20:27 viki andrzejku: this may be it, but the site isn't loading for me: http://www.brainbell.com/tuto​rs/Perl/Client_Side_Perl.htm
20:27 lucasb_ viki: did benchamark only the range flat snippet? won't the deleted pull-all method make a difference in other use cases?
20:27 lucasb_ *did you
20:29 lucasb_ *push-all :)
20:29 viki lucasb_: doubt it. The only thing re-implementing push-all would save is a method call, 'cause it'd be the same impl. as pull-on, except you'd be pushing to $target instead of returning the result and looking for iterend instead of the first found value
20:29 viki lucasb_: well, a method call *per item*
20:30 lucasb_ viki: ok
20:32 viki m: my @a; @a[$_] = ^3 .List for ^10_000; @a[$_][0] = ^3 .List for ^10000; dd @a
20:32 camelia rakudo-moar b6de5e: OUTPUT«Cannot modify an immutable Int␤  in sub postcircumfix:<[ ]> at /home/camelia/rakudo-m-inst-2/share​/perl6/runtime/CORE.setting.moarvm line 1␤  in block  at <tmp> line 1␤␤»
20:32 viki :/
20:33 lucasb_ .oO( "The Immutable Integer" sounds like a cool band name )
20:33 andrzejku I think the future is Perl for Android and iOS but I have no idea how is working
20:33 rurban joined #perl6
20:34 bstamour What about "The Immutable Rat" instead? ;)
20:35 timotimo on devices that only have like 256 megabytes of ram, it's a bad idea to run a rakudo-moar that already takes about 60 megs to just start up and compile the main program :P
20:36 andrzejku timotimo, how the ruby mine works?
20:36 andrzejku ruby motion, pardon
20:36 andrzejku there are already great apps made with it
20:37 timotimo ruby motion?
20:37 stux|RC-only joined #perl6
20:37 andrzejku timotimo, http://www.rubymotion.com/
20:38 viki star: for ^50 { <a b c>[^3 for ^1000].flat.eager }; say now - INIT now
20:38 camelia star-m 2016.10: OUTPUT«2.6514073␤»
20:38 viki star: for ^50 { <a b c>[^3 for ^1000].flat.eager }; say now - INIT now
20:38 camelia star-m 2016.10: OUTPUT«2.56446215␤»
20:38 viki m: for ^50 { <a b c>[^3 for ^1000].flat.eager }; say now - INIT now
20:38 camelia rakudo-moar b6de5e: OUTPUT«3.18496066␤»
20:38 viki m: for ^50 { <a b c>[^3 for ^1000].flat.eager }; say now - INIT now
20:38 camelia rakudo-moar b6de5e: OUTPUT«3.23080829␤»
20:38 viki /o\
20:38 TEttinger joined #perl6
20:38 viki lucasb_: good spot. seems like it could use a custom push-all after all
20:39 timotimo andrzejku: well, we're wasting a lot of ram, we can quite probably do much better somewhat soon
20:39 * viki is off for the day in 11 minutes, so will add it tomorrow or the weekend
20:40 stux|RC-only joined #perl6
20:40 andrzejku timotimo, do you mean perl6 is wasting?
20:40 timotimo yes
20:40 andrzejku well
20:41 viki lucasb_: or not... I'm getting the same diff for the original bench I used, so it's likely star being slower :o
20:41 andrzejku timotimo, I think it is design problem
20:41 viki benchable6: help
20:41 benchable6 viki, Like this: benchable6: f583f22,HEAD my $a = "a" x 2**16;for ^1000 {my $b = $a.chop($_)}
20:42 andrzejku timotimo, it will be much more better to throw out nqp
20:42 andrzejku and do what lisp languages do
20:42 lucasb_ viki: star being... faster, you mean?
20:42 timotimo throw out nqp and write everything in pure perl6?
20:42 andrzejku write a base in C/C++ and do as much as we can in perl6
20:42 AlexDaniel viki: you can try it, but right now benchable is a bit… broken :)
20:42 viki benchable6: 1b840f1,HEAD for ^50 { <a b c>[^3 for ^1000].flat.eager };
20:42 benchable6 viki, starting to benchmark the 2 given commits
20:43 benchable6 viki, benchmarked the given commits, now zooming in on performance differences
20:43 andrzejku then just improve performance by rewrite most critical things to native again
20:43 benchable6 viki, ¦«1b840f1»:2.3638␤¦«61a18c0»:2.8944␤¦«HEAD»:2.8443
20:43 AlexDaniel benchable6: 1b840f1,HEAD for ^50 { <a b c>[^3 for ^1000].flat.eager };
20:43 benchable6 AlexDaniel, starting to benchmark the 2 given commits
20:43 andrzejku timotimo, I tried to understand nqp but it is not described well
20:43 AlexDaniel let's give it another try just in case… :)
20:44 viki m: say 2.3638/2.8443
20:44 camelia rakudo-moar b6de5e: OUTPUT«0.831066␤»
20:44 viki benchable6: 1b840f1,HEAD for ^1000 { ^10_000 .flat.eager };
20:44 benchable6 AlexDaniel, benchmarked the given commits, now zooming in on performance differences
20:44 benchable6 AlexDaniel, ¦«1b840f1»:2.3712␤¦«61a18c0»:2.8496␤¦«HEAD»:2.8442
20:44 benchable6 viki, starting to benchmark the 2 given commits
20:45 benchable6 viki, benchmarked the given commits, now zooming in on performance differences
20:45 benchable6 viki, ¦«1b840f1»:2.7403␤¦«HEAD»:2.8107
20:45 viki benchable6: 1b840f1,HEAD sink(for ^1000 { ^10_000 .flat.eager });
20:45 benchable6 viki, starting to benchmark the 2 given commits
20:45 benchable6 viki, benchmarked the given commits, now zooming in on performance differences
20:45 benchable6 viki, ¦«1b840f1»:«run failed, exit code = 1, exit signal = 0»␤¦«HEAD»:«run failed, exit code = 1, exit signal = 0»
20:46 timotimo andrzejku: code written in nqp is already many times faster than the equivalent code written in perl6
20:46 timotimo why would it be faster to rewrite that code in perl6?
20:46 lucasb_ in sink((for ...)) another pair of parentheses?
20:46 andrzejku timotimo, yeah because perl6 is compiled to nqp
20:46 lucasb_ sink is a statement or subroutine? I didn't find its definition in the source...
20:47 viki m: sink
20:47 camelia rakudo-moar b6de5e: OUTPUT«5===SORRY!5===␤Whitespace required after keyword 'sink'␤at <tmp>:1␤------> 3sink7⏏5<EOL>␤Missing block or statement␤at <tmp>:1␤------> 3sink7⏏5<EOL>␤    expecting any of:␤        term␤␤»
20:47 viki :)
20:47 timotimo what do you mean by "perl6" in that sentence?
20:47 andrzejku perl6 -> nqp -> native calls
20:47 timotimo that seems wrong
20:47 andrzejku perl6 -> native calls
20:48 andrzejku timotimo, look at lisp
20:48 lucasb_ perl 6 -> ... -> the machine -> the electrons -> the mind -> the universe
20:49 andrzejku as Stallman quote says "List is a language created by god"
20:49 viki AlexDaniel: ... oops
20:49 andrzejku it got very tiny vm
20:49 AlexDaniel viki: not your fault
20:49 viki *phew* :D
20:49 AlexDaniel Unhandled exception in code scheduled on thread 13
20:49 AlexDaniel Unhandled exception in code scheduled on thread 12
20:49 AlexDaniel Cannot send a message on a closed channel
20:50 AlexDaniel I think this is the same issue as this: https://github.com/perl6/whateverab​le/issues/60#issuecomment-262159968
20:50 benchable6 joined #perl6
20:52 viki Oh, so them it *is* my fault? I ran a command in #zofbot
20:52 * viki relocates
20:53 AlexDaniel viki: but you did nothing wrong, it crashed because there is some issue in rakudo
20:58 moritz has anybody translated the "Higher Order Perl" examples to Perl 6 yet?
20:58 tadzik ooh, that's a very cool idea
20:59 tadzik iirc the regular ones are, hm, prety Oldschool Perl :)
20:59 moritz it's from 2005 :-)
21:01 zakharyas joined #perl6
21:01 moritz http://hop.perl.plover.com/ has links to JS and Ruby translations
21:02 masak tadzik: that's not my memory of it, though it's been a while since I read it.
21:02 masak tadzik: I remember the code in that book being highly readable, and admirably clean.
21:03 masak it's one of the books that really made me appreciate Perl as an adequate Lisp :P
21:03 tadzik hm, I was reading it on a kindle, which is not perfect for code examples, maybe that skews my memory a bit
21:03 moritz s/one of// for me
21:05 firstdayonthejob joined #perl6
21:09 timotimo andrzejku: as long as you're not showing actual implementation, your suggestions sound like "we should add blast processing to perl6" to me
21:09 andrzejku timotimo, I am not an expert
21:10 andrzejku if I got a perl guy support
21:10 andrzejku I will
21:11 Ven joined #perl6
21:12 hankache joined #perl6
21:17 AlexDaniel soooo… I'm thinking…
21:18 AlexDaniel the idea of changing the setter a little bit is not that unusual
21:18 AlexDaniel and the Proxy solution is just too painful
21:19 AlexDaniel having a module to do such a basic thing is weird
21:20 AlexDaniel the guy is right
21:22 Ven_ joined #perl6
21:33 wamba m: my $a=(1,3,2) but role :: { method sort { self.pick(*).list but $?ROLE } }; say ($a, {.sort} ... *)[^10]
21:33 camelia rakudo-moar 172898: OUTPUT«((1 3 2) (1 3 2) (2 3 1) (2 1 3) (1 2 3) (1 2 3) (3 2 1) (3 1 2) (2 3 1) (1 3 2))␤»
21:36 espadrine joined #perl6
21:36 Ven joined #perl6
21:47 kyclark_ joined #perl6
21:55 imcsk8 joined #perl6
21:59 viki AlexDaniel, so.... add all the thing to core? :)
22:00 AlexDaniel viki: we have added TWEAK to the core, this is the same thing
22:00 AlexDaniel and we also have .indent
22:00 viki I don't think the guy is right (don't even know if it's a guy)
22:00 kyclark_ joined #perl6
22:01 AlexDaniel that's a good point
22:02 viki His premise is the attribute must have the same name as accessor for some reason, I'm not really buying that as a reason to add another core feature
22:02 AlexDaniel because that's what we provide by default??
22:02 viki TWEAK solves a real problem, because without it, you have to move defaults of all attributes
22:03 viki The solution to his problem is a prive attribute with a public accessor, there won't be any code savings on top of that
22:04 viki So we'd be adding maintenance burden for some purely psychological ideal that all attributes must be named the same as their accessors
22:04 viki Makes no sense to me
22:04 AlexDaniel we can keep bragging how creating a class is just a few lines and everything is autogenerated for you, but if there's no way to have your own setter then it's like one step forward and two steps back
22:04 viki But there *is*!
22:05 viki And if you don't like it, you can make a module
22:05 AlexDaniel yeah, using a Proxy. How easy and readable that is!
22:05 viki That's what modules are for
22:05 viki No, using a trait
22:05 bstamour left #perl6
22:05 AlexDaniel huh?
22:06 viki And this is the first time I see anyone complain about it in a year and all of a sudden you're bent on making it a core feature
22:06 AlexDaniel well that's how TWEAK got implemented
22:06 timotimo no
22:06 viki Can we not use "TIMTaoDy" and "but we added that useless feature already" as an excuse to adding more useless feature
22:07 timotimo people have been complaining about TWEAK being missing for years
22:07 AlexDaniel ah ok
22:07 timotimo at the very least one year
22:07 viki AlexDanel, not at all, I went on at least two rants about TWEAK and mst made fun of us for Moose have it and us not having it several times, that's at least what I witnessed, there may have been more
22:08 Ven joined #perl6
22:09 viki And .indent is used by heredocs anyway :)
22:09 RabidGravy what is TWEAK?
22:09 RabidGravy or is there a roast test I can examine to see what it does?
22:10 viki RabidGravy it's an awesome new feature that let's you do BUILD without having to move defaults of all attributes
22:10 viki RabitGravy there are docs for it :)
22:11 viki https://docs.perl6.org/langua​ge/objects#index-entry-TWEAK
22:12 RabidGravy got it
22:13 perlawhirl joined #perl6
22:26 kyclark_ joined #perl6
22:27 RabidGravy on the attribute thing, you could make the separately named r/w accessors with a trait
22:29 RabidGravy without a proxy
22:30 RabidGravy but you'd have to wrap the attribute's compose method or something
22:31 RabidGravy because you don't know what class you're in until that point
22:35 RabidGravy if one was to put something in the MOP for it, a compose hook on the attribute which could return some methods might be a more flexible alternative
22:43 lucs p
22:56 perlawhirl joined #perl6
22:57 labster joined #perl6
23:03 wamba joined #perl6
23:09 rurban1 joined #perl6
23:11 mr-foobar joined #perl6
23:19 kalkin-_ When you try to do zef install Task::Start it will fail because LWP:Simple is missing IO::Socket::SSL. After installing IO::Socket::SSL by hand it works
23:19 yoleaux 23 Nov 2016 13:17Z <viki> kalkin-_: FWIW, nine++ improved upon your PR (also, I recommend you join #perl6-dev): https://github.com/rakudo/rakudo/commit/​b597b7cd814ec19e57f8e34ace36be9811d72ba8
23:19 timotimo i think the IO::Socket::SSL dependency is an optional one
23:20 * kalkin-_ is not seeing any IO::Socket::SSL dependency definition in perl6-lw--simple/META.info
23:22 kalkin- There is an issue from coke https://github.com/perl6/perl6-lwp-simple/issues/2 He wanted to reopen a new issue, but hasn't followed through on it(?)
23:22 viki kalkin-: right, it's an *optional* dep.
23:22 * viki reads a few lines higher
23:23 viki Oh....
23:23 * viki tries
23:24 viki Ah
23:25 viki No, I see commits to Pod::ToBigPage that address this https://github.com/gfldex/pe​rl6-pod-to-bigpage/issues/5
23:26 viki kalkin-: what's the failure output?
23:26 kalkin- just closed the console, will restart it
23:28 viki `zef install Task::Star` succeeded, but I'm pretty sure IOSSSL was already installed on my box.
23:31 viki kalkin-: OK. Well, there are two ways to fix this. #1, move `p6doc` dep in Task::Star to be before LWP::Simple. It'll bring in Pod::To::BigPage with it, which has IO::Socket::SSL dep on it. Or #2, reopen the issue you mentioned for LWP::Simple and make the author toss SSL tests or add it as a dep.
23:32 viki Right now I see there's an arbitrary env var that one can set to avoid the test: https://github.com/perl6/perl6-lwp-s​imple/blob/master/t/basic-auth.t#L12, but that's not the default condition
23:33 viki There's use Test::When <online>; one can use, or if module dep is not desirable, at least it's var, ONLINE_TESTING can be used when it *is* turned on: https://github.com/zoffixz​net/perl6-Test-When#online
23:33 viki </shameless-plug>
23:34 viki ONLINE_TESTING is not part of Lancaster convention, but other vars in that module *are*, so there's a chance of wider adoption of all of them by module installers
23:36 viki Ah, I see the current choice was suggested here: https://github.com/rakudo/star/i​ssues/77#issuecomment-258132929
23:37 viki #WhyYourSoftwareWorksThatWay :)
23:39 kalkin- https://gist.github.com/anonymous​/f237ead6bdf9a0bf25ef44f2b5fedd38
23:40 kalkin- now I try to install panda without Task::Star, AFAIR it failed a few days ago with the same error
23:40 kalkin- ohh viki meant p6doc not panda
23:41 kalkin- hmm seems to work
23:42 kalkin- I think reopening the issue would be the best thing, I don't like non obvious fixes like the first one proposed by viki
23:42 Bigger joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo