Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-02-21

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:00 cale2 something that is handy... maybe like a csv parser?
00:01 AlexDaniel is there any way to make perl 6 repl preserve the history?
00:01 AlexDaniel I'm using readline
00:03 timotimo it should preserve the history when it uses readline
00:04 timotimo worst case, use rlwrap
00:05 [Coke] m: class :: { 5_0000; 1 }
00:05 camelia rakudo-moar 80e0bc: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (line 1)␤Useless use of constant integer 50000 in sink context (line 1)␤»
00:05 AlexDaniel timotimo: it doesn't
00:06 [Coke] any way to make that not complain?
00:06 AlexDaniel m: class :: { 5_0000; eager 1 }
00:06 camelia rakudo-moar 80e0bc: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (line 1)␤Useless use of constant integer 50000 in sink context (line 1)␤»
00:06 AlexDaniel ah
00:06 AlexDaniel m: class :: { eager 5_0000; 1 }
00:06 camelia rakudo-moar 80e0bc: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (line 1)␤Useless use of constant integer 50000 in sink context (line 1)␤»
00:06 AlexDaniel :|
00:07 AlexDaniel [Coke]: but what is this code doing?
00:07 AlexDaniel like, why would you have something like this?
00:07 [Coke] part of the xt/examples-compilation.t I'm working on; I can't seem to catch the warning, either.
00:07 AlexDaniel timotimo: no, it doesn't preserve the history if I rerun it
00:08 AlexDaniel timotimo: normal history works, yes
00:08 IRCFrEAK joined #perl6
00:08 IRCFrEAK left #perl6
00:08 [Coke] (er, the output)
00:09 [Coke] with that code in $code, I do this: { $*ERR = IO::String.new(); $*OUT = IO::String.new(); try EVAL $code }
00:09 [Coke] and that warning is still output.
00:10 IOninja m: class :: { eager 5_0000; $ = 1 }
00:10 camelia rakudo-moar 80e0bc: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant integer 50000 in sink context (line 1)␤»
00:10 IOninja m: class :: { $ = 5_0000; $ = 1 }
00:10 camelia rakudo-moar 80e0bc: ( no output )
00:10 IOninja m: eager 5000
00:10 camelia rakudo-moar 80e0bc: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant integer 5000 in sink context (line 1)␤»
00:10 * AlexDaniel still does not understand why would you ever have something like this
00:10 IOninja hmmm
00:10 AlexDaniel but eager was working some time ago, no?
00:11 AlexDaniel c: HEAD~500 eager 5000
00:11 committable6 AlexDaniel, ¦«HEAD~500»: WARNINGS for /tmp/_Z2P5njeEE:␤Useless use of constant integer 5000 in sink context (line 1)
00:11 AlexDaniel 6c: eager 5000
00:11 committable6 AlexDaniel, ¦«2015.12,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07.1,2016.08.1,2016.09,2016.10,2016.11,2016.12,2017.01,HEAD»: WARNINGS for /tmp/gKpMsRE8V3:␤Useless use of constant integer 5000 in sink context (line 1)
00:11 AlexDaniel no
00:12 [Coke] AlexDaniel: the examples compiler wraps every code snippet in an anonymous class so we can test method declarations.
00:12 [Coke] and type/Int.pod6 has a block with a bunch of constants showing syntax.
00:13 [Coke] and then I golfed it.
00:14 IOninja um... why does it wrap them in a class?
00:14 timotimo [Coke]: you'd want to use "quietly", i'd expect
00:14 IOninja It won't help
00:15 [Coke] m: quietly class :: { 5_00000; True };
00:15 camelia rakudo-moar 80e0bc: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant integer 500000 in sink context (line 1)␤»
00:15 [Coke] m: class :: { quietly 5_00000; True };
00:15 camelia rakudo-moar 80e0bc: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant integer 500000 in sink context (line 1)␤Useless use of constant value True in sink context (line 1)␤»
00:15 [Coke] timotimo: already tried that. :)
00:16 IOninja m: BEGIN $*ERR.close; class :: { 5_0000; 1 }
00:16 camelia rakudo-moar 80e0bc: ( no output )
00:17 [Coke] IOninja: Note that my first pass had *ERR overridden into an IO::String
00:17 [Coke] and yet it was still emitted on the main $*ERR, apparently.
00:19 [Coke] There's no way to get the effect of 'perl6 -c' IN rakudo, is there?
00:19 IOninja prolly don't reach it from dynamic scope or something?
00:20 [Coke] (shellig out to 'perl6 -c' is super slow; but using EVAL means I have to actually -run- the code)
00:20 [Coke] *shelling
00:21 timotimo damn
00:22 timotimo it's probably the compilers using "say" and "note" from nqp to output their stuff
00:22 pyrimidine joined #perl6
00:22 timotimo those don't look at $*OUT and $*ERR i don't think
00:22 IOninja m: say try EVAL 'sub {INIT return; class :: { 5000; 42 } }()'
00:22 camelia rakudo-moar 80e0bc: OUTPUT: «(signal SEGV)WARNINGS for /home/camelia/EVAL_0:␤Useless use of constant integer 42 in sink context (line 1)␤Useless use of constant integer 5000 in sink context (line 1)␤»
00:22 IOninja m: say try EVAL 'sub {CHECK return; class :: { 5000; 42 } }()'
00:22 camelia rakudo-moar 80e0bc: OUTPUT: «Nil␤»
00:22 [Coke] jezu.
00:22 IOninja timotimo: how come $*ERR.close works?
00:23 [Coke] nice segfault. also great idea. :)
00:23 IOninja m: say try EVAL 'sub {CHECK return "all is good, bruh"; class :: { 5000; 42 } }()'
00:23 camelia rakudo-moar 80e0bc: OUTPUT: «Nil␤»
00:23 IOninja hm
00:23 timotimo because that closes the underlying file descriptor
00:24 IOninja timotimo: and $*IN.close doesn't?
00:24 AlexDaniel I still don't buy the idea of wrapping something into a class blindly
00:24 timotimo in what way does it not work?
00:24 IOninja I still don't get why it's wrapped in a class at all...
00:24 [Coke] IOninja: so a bare 'method' works.
00:24 [Coke] which is most of the examples being testing in the Type/ pages.
00:25 IOninja timotimo: last three lines in this log: https://irclog.perlgeek.de/perl6-dev/2017-02-19#i_14129069
00:25 IOninja I see.
00:25 [Coke] AlexDaniel: What's your alternative?
00:25 AlexDaniel [Coke]: add some heuristics to look for methods?
00:26 [Coke] Sure, we already have a check, easy enough.
00:26 AlexDaniel … or wrap everything in class :: { method foo { ……… } }
00:27 AlexDaniel m: class foo { method foo { method abc { 42 } } }
00:27 camelia rakudo-moar 80e0bc: ( no output )
00:27 IOninja m: EVAL 'sub {CHECK return; class :: { 5000; 42 } }()'
00:27 camelia rakudo-moar 80e0bc: OUTPUT: «===SORRY!===␤Attempt to return outside of any Routine␤»
00:27 IOninja orly?
00:27 IOninja tis a bug or?
00:27 AlexDaniel IOninja: well, LTA for sure
00:27 IOninja m: sub {CHECK return; class :: { 5000; 42 } }()
00:27 camelia rakudo-moar 80e0bc: OUTPUT: «===SORRY!===␤Attempt to return outside of any Routine␤»
00:27 IOninja m: sub {INIT return; class :: { 5000; 42 } }()
00:27 camelia rakudo-moar 80e0bc: OUTPUT: «(signal SEGV)WARNINGS for <tmp>:␤Useless use of constant integer 42 in sink context (line 1)␤Useless use of constant integer 5000 in sink context (line 1)␤»
00:29 IOninja https://rt.perl.org/Ticket/Display.html?id=130825
00:29 IOninja I guess it don't make any sense for it to work
00:29 IOninja 'cause the sub would be executed after CHECK and INIT and we're asking it to time travel there.
00:32 [Coke] IOninja: I jsut need a 'return', I don't need to make it run sooner.
00:33 [Coke] oh. or I can just wrap it all in if False { }
00:40 aborazmeh joined #perl6
00:40 aborazmeh joined #perl6
00:44 ZzZombo WTF, I can't drag selected text in Atom?? Reminds me why I refused to use it, lack of crucial features that even Notepad has.
00:45 samcv good *
00:46 AlexDaniel m: say ‘good’, **
00:46 camelia rakudo-moar 80e0bc: OUTPUT: «good**␤»
00:51 hobbs I can't say I've ever tried to do that in my life
00:53 samcv commas are useful in say. been using them more recently
00:53 samcv to avoid having to ~ them all
00:53 AlexDaniel yup
00:54 AlexDaniel it is not identical though
00:54 AlexDaniel m: say ‘good’, **
00:54 camelia rakudo-moar 80e0bc: OUTPUT: «good**␤»
00:54 AlexDaniel m: say ‘good’ ~ **
00:54 camelia rakudo-moar 80e0bc: OUTPUT: «sub (*@_) { #`(Sub|33031456) ... }␤»
00:54 AlexDaniel m: say “good {**}”
00:54 camelia rakudo-moar 80e0bc: OUTPUT: «good HyperWhatever<69369648>␤»
00:54 hobbs good HyperWhatever indeed.
00:56 Geth ¦ doc/coke/examples: 349ecc67b8 | (Will "Coke" Coleda)++ | xt/examples-compilation.t
00:56 Geth ¦ doc/coke/examples: Use EVAL instead of perl6 -c
00:56 Geth ¦ doc/coke/examples:
00:56 Geth ¦ doc/coke/examples: Compile but execute as little as possible.
00:56 Geth ¦ doc/coke/examples: review: https://github.com/perl6/doc/commit/349ecc67b8
00:58 Actualeyes joined #perl6
01:00 samcv welp Unhandled exception in code scheduled on thread 19
01:08 cibs joined #perl6
01:30 mcmillhj joined #perl6
01:37 andrzejku joined #perl6
01:39 andrzejku what to do when you cann't sleep at night :S
01:39 BenGoldberg joined #perl6
01:40 ZzZombo Have sex
01:44 andrzejku not possible
01:46 cale2 andrzejku: Are you in a coding mood or a writing modd?
01:47 ZzZombo Open astrophysical lecture with lots of formulea and try to comprehend them.
01:48 andrzejku my kid woke me up and I cann't back to sleep
01:48 andrzejku probably coding mood
01:48 andrzejku :P
01:48 ZzZombo Just don't release it ever :P
01:49 andrzejku maybe it is time to do some perl
01:50 cale2 andrzejku: Do you already program in perl6? Or are you going to pick it up now?
01:51 andrzejku I read many Perl6 things
01:51 andrzejku but mostly I need pick it up
01:52 AlexDaniel andrewalker: write some tests perhaps? https://github.com/perl6/roast/issues
01:54 cale2 AlexDaniel: Tests still need to be written?
01:55 ZzZombo Can I make <.ws> non-greedy? I want it not to grab the newline after it.
01:55 ZzZombo oh, can't I just use \s*?\n
01:56 * [Coke] wonders why we have code samples with nested B<> and L<> formtting codes.
01:56 andrzejku AlexDaniel that could be too hard for me :P
01:57 AlexDaniel cale2: well sure
01:57 AlexDaniel cale2: unless the amount of open issues is 0, yes, some tests are needed :)
01:58 Geth ¦ doc/coke/examples: 9e394d46df | (Will "Coke" Coleda)++ | doc/Language/control.pod6
01:58 Geth ¦ doc/coke/examples: change coding style
01:58 Geth ¦ doc/coke/examples: review: https://github.com/perl6/doc/commit/9e394d46df
01:58 Geth ¦ doc/coke/examples: c36dd9a66c | (Will "Coke" Coleda)++ | xt/examples-compilation.t
01:58 Geth ¦ doc/coke/examples: Handle Pod Formatting codes
01:58 Geth ¦ doc/coke/examples: review: https://github.com/perl6/doc/commit/c36dd9a66c
02:01 ZzZombo token value { [<string> || \w+]\s*?\n }
02:01 ZzZombo token string { '"' <( [\N | \\\N]*? )> '"' }
02:01 ZzZombo Yet "!#$w52\"" doesn't get rid of the "" even though it should by the rules value->string?
02:03 Geth ¦ doc: ccdedd387b | (Will "Coke" Coleda)++ | doc/Type/Proc.pod6
02:03 Geth ¦ doc: remove trailing whitespace
02:03 Geth ¦ doc: review: https://github.com/perl6/doc/commit/ccdedd387b
02:03 Geth ¦ doc: a2568a5324 | (Will "Coke" Coleda)++ | doc/Type/IO.pod6
02:03 Geth ¦ doc: fix typo
02:03 Geth ¦ doc: review: https://github.com/perl6/doc/commit/a2568a5324
02:06 ZzZombo According to Grammar::Trace, the value rule NEVER calls the string rule, yet it matches. WTF?
02:08 [Coke] yay, examples test runs in ⅓ the time.
02:14 pyrimidine joined #perl6
02:16 Actualeyes joined #perl6
02:19 ZzZombo m: say so "!#$w52\"" ~~ /'"' <( [\N | \\\N]*? )> '"'/
02:19 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$w52' is not declared␤at <tmp>:1␤------> 3say so "!#7⏏5$w52\"" ~~ /'"' <( [\N | \\\N]*? )> '"'/␤»
02:19 ZzZombo m: say "!#w52\"" ~~ /'"' <( [\N | \\\N]*? )> '"'/
02:19 camelia rakudo-moar 80e0bc: OUTPUT: «Nil␤»
02:19 ZzZombo m: say '"!#w52\""' ~~ /'"' <( [\N | \\\N]*? )> '"'/
02:19 camelia rakudo-moar 80e0bc: OUTPUT: «「!#w52\"」␤»
02:20 ZzZombo wtf
02:20 ZzZombo here is works
02:20 ZzZombo it*
02:24 IOninja rules don't backtrack; regexes do.
02:25 IOninja andrzejku: easy: take a sleeping pill
02:25 andrzejku lulsh I hate sleeping pills d;
02:25 andrzejku that's unhealthy
02:26 IOninja They're safe enough to give pregnant women.
02:26 andrzejku I am not pregnant :S
02:26 AlexDaniel … fair enough…
02:26 IOninja heh
02:26 IOninja dat logic
02:31 ZzZombo why is there a page for https://docs.perl6.org/language/list but no for hash?
02:32 IOninja because hashes are easier to understand.
02:33 IOninja "Hashes and Maps: you know what to do, bruh"
02:33 IOninja There is one for Setty/Baggy, so those hash-likes are covered.
02:35 * IOninja glances at trends on Twitter and Facebook
02:35 IOninja So nazis are like celebrities in the US now? Wow
02:37 cdg joined #perl6
02:38 cale2 nazis are everywhere now. they're your baker, your barber, and under your bed
02:39 cale2 Any news on the perl6 toolchain? I'm reading docs about where it's headed in the future. I'm wondering what step it's at now
02:39 hobbs IOninja: not last time I checked?
02:39 samcv ZzZombo, there's this https://docs.perl6.org/type/Hash
02:40 IOninja cale2: bug jdv79
02:43 cale2 Reason I ask is because I'm working on a little tutorial about up-to-date module publishing
02:46 IOninja hobbs: half a million tweets and 170K facebooks for some nazi guy. I'd say that's celebrity area :)
02:46 cale2 I'm using zef for sure, but I'm looking for the most up-to-date authoring tool as well
02:46 IOninja buggable: eco distribution
02:46 buggable IOninja, Found 5 results: Test::META, Distribution::Common, Distribution::Common::Remote, Task::Noise, Ddt. See http://modules.perl6.org/#q=distribution
02:46 IOninja buggable: eco Ddt
02:46 buggable IOninja, Ddt 'Distribution Development Tool a replacement for mi6': https://github.com/kalkin/Ddt
02:46 IOninja cale2: that's probably the most one. Though I never used any...
02:46 cale2 ahhh, so mi6 is out of date... did not know
02:46 IOninja cale2: well... that's just some author's claim.
02:46 cale2 I think many newbies will be accustomed to things like `cargo new` or `mix new` and shebam, your directory structure is built
02:46 IOninja *[citation needed] :)
02:46 cale2 The citation is literally my own self :)
02:47 IOninja And everyone's like you, naturally ;)
02:47 cale2 In any case, mi6 is the better name
02:47 cale2 sad if it's abandoned D:
02:47 IOninja What makes you think it's abandoned?
02:47 IOninja Last commit was a month ago.
02:48 cale2 oh, nice :)
02:48 IOninja ....
02:50 IOninja In fact, if you discount a typo fix, Ddt is only 7 days newer and I never heard of anyone using it, other than its author.
02:50 cale2 ah
02:51 cale2 IOninja: did you see this? https://github.com/WildYorkies/perl6-state-of-the-ecosystem
02:52 cale2 I'm looking for help from others to beef that up. Sort of a companion to "most wanted modules"
02:55 andrzejku hey I know that's very late but could look at my algorithm?
02:56 andrzejku https://github.com/damaxi/Algorithm/blob/master/guess_number.p6
02:56 andrzejku in my results binary search is slower
02:56 andrzejku however there less steps to do but logic is more complicated
02:58 IOninja MY EYES!
02:58 IOninja cale2: well, I don't use Perl 6, so it's kinda of little interest to me :)
02:59 hobbs well yeah, that's much more complicated code, and doesn't use a simple for loop, and you're dealing with a really small case
02:59 cale2 IOninja: that's what everyone says :P
03:00 andrzejku hobbs ? I did tests for 1000 when 999
03:00 andrzejku is guess number
03:00 andrzejku and binary search is slower every time
03:00 hobbs yes, and 1000 is a very small number
03:00 andrzejku :S
03:00 andrzejku ok?
03:00 andrzejku what number should I choice
03:01 andrzejku hobbs I suppose the binary search is just fucked up
03:01 IOninja cale2: sounds like you should start showing it to users of Perl 6 then :)
03:01 andrzejku Looking for value: 80000
03:01 andrzejku Guessed value: 80000
03:01 andrzejku Increment search 0.0267904761904762
03:01 andrzejku Guessed value: 80000
03:01 andrzejku Binary search 0.0999639665589252
03:02 andrzejku how the fuck find algorithm is implemented in Perl6?
03:02 andrzejku :D
03:03 hobbs well yeah, that too. Actually I'm having a hard time figuring out why your code even *works* for values over 100 instead of looping forever
03:04 hobbs I guess because that else case eventually makes it count by 1
03:04 andrzejku hobbs it is checked
03:05 hobbs meaning what?
03:05 andrzejku for every case there long2(n) computations
03:05 andrzejku and this is constant
03:05 andrzejku while simple increment look up is n
03:05 andrzejku in worst case
03:06 andrzejku however something wrong with perl
03:06 hobbs that would be true if your code wasn't broken.
03:07 labster joined #perl6
03:07 andrzejku or I need analyze case with list of elements
03:07 andrzejku what could be more hard to iterate
03:08 andrzejku probably it is perl6 paradox
03:09 andrzejku if your code need to invoke many things make it simpler and idiotic it would be faster anyway
03:09 andrzejku :D
03:09 hobbs probably you're typing line after line of utter nonsense
03:09 hobbs which is the same way your code came about :)
03:09 andrzejku no
03:10 andrzejku lulsh
03:10 hobbs I added "say $mid" to your binary search loop, notice anything? http://paste.scsys.co.uk/554563
03:10 andrzejku amm shit happend
03:11 andrzejku i hardcoded :D two variables wait
03:13 cale2 andrzejku: IDK about your algorithm, but you should add a MAIN sub to your script. sub MAIN(:$min = 1, :$max = 200)
03:14 cale2 and do `my Int $guess = ^$max.pick`
03:14 andrzejku hobbs thnks :) for help now it is working
03:14 andrzejku Looking for value: 80000
03:14 andrzejku Guessed value: 80000
03:14 andrzejku Increment search 0.0270540940359567
03:14 andrzejku Guessed value: 80000
03:14 andrzejku Binary search 0.000606746010671407
03:14 andrzejku cale2 sure I will fix it
03:14 andrzejku there no more perl6 paradox :D
03:16 cale2 you can also run perl6 on glot.io/new/perl6
03:18 andrzejku cale2 are you about ^$max.pic?
03:18 cale2 m: say ^200.pick
03:18 camelia rakudo-moar 80e0bc: OUTPUT: «Potential difficulties:␤    Precedence of ^ is looser than method call; please parenthesize␤    at <tmp>:1␤    ------> 3say ^2007⏏5.pick␤^200␤»
03:18 cale2 m: say (^200).pick
03:18 camelia rakudo-moar 80e0bc: OUTPUT: «72␤»
03:18 cale2 there we go lol. wrap it in parens
03:18 andrzejku m: say (1..100).pick
03:18 camelia rakudo-moar 80e0bc: OUTPUT: «84␤»
03:18 hobbs ($min..$max).pick even :)
03:19 BenGoldberg m: say ^200 .pick;
03:19 camelia rakudo-moar 80e0bc: OUTPUT: «179␤»
03:19 andrzejku the ^ pick from 0
03:19 cale2 m: my $max = 200; with $max { .pick.say }
03:19 camelia rakudo-moar 80e0bc: OUTPUT: «200␤»
03:20 cale2 m: my $max = 200; with $max { .pick.say }
03:20 camelia rakudo-moar 80e0bc: OUTPUT: «200␤»
03:20 cale2 m: my $max = 200; with $max { say $_.pick }
03:20 camelia rakudo-moar 80e0bc: OUTPUT: «200␤»
03:20 cale2 m: my $max = 200; with $max { say ^$_ .pick }
03:20 camelia rakudo-moar 80e0bc: OUTPUT: «192␤»
03:20 cale2 haha
03:20 cale2 yeah, it picks from 0
03:20 cale2 min..max would work
03:21 cale2 m: my $max = 200; with $max { ^$_ .pick.say }
03:21 camelia rakudo-moar 80e0bc: OUTPUT: «163␤»
03:21 BenGoldberg m: say ^2.pick xx 20;
03:21 camelia rakudo-moar 80e0bc: OUTPUT: «Potential difficulties:␤    Precedence of ^ is looser than method call; please parenthesize␤    at <tmp>:1␤    ------> 3say ^27⏏5.pick xx 20;␤(^2 ^2 ^2 ^2 ^2 ^2 ^2 ^2 ^2 ^2 ^2 ^2 ^2 ^2 ^2 ^2 ^2 ^2 ^2 ^2)␤»
03:21 BenGoldberg m: say ^2. pick xx 20;
03:21 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Decimal point must be followed by digit␤at <tmp>:1␤------> 3say ^2.7⏏5 pick xx 20;␤»
03:21 BenGoldberg m: say ^2 .pick xx 20;
03:21 camelia rakudo-moar 80e0bc: OUTPUT: «(0 0 0 0 1 1 0 1 0 1 0 1 0 0 0 1 1 0 0 0)␤»
03:23 hobbs andrzejku: http://paste.scsys.co.uk/554564 -- this seems more reasonable (and 10x faster)
03:24 hobbs hmm, actually that has an off-by-1 that needs a fix
03:25 hobbs I think "$low = $mid + 1" repairs it :)
03:27 zengargoyle joined #perl6
03:27 andrzejku hobbs yeah :D
03:28 andrzejku hobbs 1 kind of proximity
03:29 noganex_ joined #perl6
03:40 grondilu joined #perl6
03:40 grondilu Hello, #perl6
03:40 grondilu I thought about a one-liner to check for typo in a text:
03:41 grondilu my @dict = slurp("/usr/share/dict/american-english"); say $text.grep(none(@dict))
03:42 grondilu I'm wondering if it's reasonable to use the C<none> junction with thousands of words
03:43 BenGoldberg my %dict := Set.new: slurp("/usr/share/dict/american-english"); say !%dict{$text}
03:43 grondilu (btw I forgot a .words above)
03:44 BenGoldberg Any junction with more than a handful is most likely to be less efficient than using a hash or set.
03:44 grondilu ok
04:08 geekosaur joined #perl6
04:11 pyrimidi_ joined #perl6
04:25 itcharlie joined #perl6
04:27 ZzZombo WTF is this zef thing, why does it suddenly spit out a huge wall of text of MS Powershell usage?
04:27 nebuchadnezzar joined #perl6
04:49 ugexe because i didnt want to think of how to spit out a wall of powershell usage not-suddenly
04:50 ilbelkyr joined #perl6
04:57 Cabanoss- joined #perl6
05:02 ZzZombo WTF
05:04 ZzZombo Lucida COnsole CAN display 「"My Data"」 no problem in the IRC client, but not in cmd window even after chcp 65001
05:10 wamba1 joined #perl6
05:12 itcharlie left #perl6
05:31 xtreak joined #perl6
05:45 cibs joined #perl6
05:47 CIAvash joined #perl6
05:56 cibs joined #perl6
05:58 mroy joined #perl6
06:00 mroy Will perl6 have IO::Socket::UNIX?
06:01 mroy Btw, hello all.
06:05 curan joined #perl6
06:07 Resol_ joined #perl6
06:07 masak hello, mroy
06:08 masak as to your question, I don't know
06:08 masak in Rakudo, there's currently IO::Socket::INET and IO::Socket::Async
06:10 mroy Thank you, masak. There is IO::Pipe. Wanted to try IO::Socket::UNIX with perl6.
06:11 ZzZombo joined #perl6
06:17 astj joined #perl6
06:18 mroy Also searched for socketpair. Oh, it's no where to be found in perl6. Where are thou my friend socketpair. :)
06:26 masak mroy: are you aware of the possibility to Inline::Perl5?
06:26 * masak often suspects that people who complain about missing modules are not aware of Inline::Perl5 :)
06:26 gdonald joined #perl6
06:27 mroy Thanks masak.
06:30 mroy Was hoping for UNIX domain sockets via socketpair, similarly as in perl5.
06:32 ZzZombo WTF, seriously
06:32 ZzZombo why the fuck cmd window refuses to show 「 and 」 as such???
06:32 ZzZombo I even changed to font to one that does have them.
06:40 masak could be encoding related rather than font related
06:40 masak Windows is well-known for doing its own thing with encodings
06:43 geekosaur chcp 65001
06:44 ufobat joined #perl6
06:46 geekosaur (uh, be aware that that setting breaks some versions of git; note down the current setting first, if you try it)
06:51 mr_ron joined #perl6
06:52 bjz joined #perl6
06:52 ZzZombo geekosaur: doesn't do shit, I already invoked it.
06:53 geekosaur ok, then I guess you're in one of those lovely areas where windows does its own thing, like masak said :/
06:53 RabidGravy joined #perl6
06:54 geekosaur (also, for grins and giggles, try powershell)
06:54 geekosaur not that it's that likely to help if cmd doesn't work, but...
06:55 ZzZombo the thing is, why does it clearly works in IRC and not in the stupid console window?
06:55 geekosaur what are you using for irc?
06:55 ZzZombo mIRC
06:56 mroy masak, socketpair is mentioned in Synopsis 32 https://github.com/perl6/specs/blob/master/S32-setting-library/IO.pod
06:56 geekosaur ok, that'd make sense. the problem with cmd is that it tries to be backward compatible; "chcp 65001" helps to some extent but doesn't 100% remove the backward compat stuff
06:56 geekosaur which is why powershell might do better
06:57 geekosaur mroy, the synopses are quite old at this point. a decision was made to move anything that wasn't portable into the ecosystem, but I don't think anyone's done anything with socketpair yet
06:58 mroy thanks geekosaur. was thinking the same in regards to not being portable and the likely reason not in perl6 yet.
06:58 geekosaur ("portable" ~~ /windows || unix/)
06:59 mroy seeing the synopses gave me some hope
06:59 mroy that socketpair may be available in perl6 one day
06:59 geekosaur whereas older perl originated on unix and portability to windows has always been rather rough edged as a result
07:00 mroy that makes sense
07:04 rindolf joined #perl6
07:06 wamba1 joined #perl6
07:11 darutoko joined #perl6
07:15 Actualeyes joined #perl6
07:34 jjido joined #perl6
07:50 bjz_ joined #perl6
07:54 ufobat_ joined #perl6
07:58 grondilu m: say [\+] ^10  .tail
07:58 camelia rakudo-moar 80e0bc: OUTPUT: «45␤»
07:59 grondilu ^is that normal?  If it is, it's cool, because it means I can use the reduction metaoperator and call a method from it without using parenthesis?
07:59 grondilu m: say [\+] ^10  .elems
07:59 camelia rakudo-moar 80e0bc: OUTPUT: «10␤»
08:02 ZzZombo Holy fuck
08:03 ZzZombo Is there really NO monospaced font suitable for console window that supports 「 and 」???
08:03 ZzZombo I've tried like 10 new fonts already, they either aren't accepted by cmd.exe or lack them.
08:06 pyrimidine joined #perl6
08:07 jjido joined #perl6
08:10 masak ZzZombo: maybe you should try #windows-font-swearing instead?
08:10 ZzZombo I'm banned there, didn't meet the swearing quota.
08:11 ZzZombo anyway, gotta go.
08:11 arnsholt ZzZombo: My PuTTY shows them, uses Courier New
08:11 arnsholt Bah!
08:12 arnsholt .tell ZzZombo I get 「 and 」 in PuTTY with Courier New, FWIW
08:12 yoleaux arnsholt: I'll pass your message to ZzZombo.
08:14 grondilu so basically in http://rosettacode.org/wiki/Evaluate_binomial_coefficients#Perl_6, I could write:  [*] ($^n ... 0) Z/ 1 .. min($n - $^p, $p) .Int
08:14 grondilu instead of: ([*] ($^n ... 0) Z/ 1 .. min($n - $^p, $p)).Int
08:17 masak grondilu: yes, but I don't think the spaces version is an improvement on the parens version; rather the opposite
08:18 masak I'm biased, but I do think it's less clear relying on the precedence behavior of the spaces
08:20 masak it's like `!important` in CSS -- things were already hard enough before it
08:20 masak in this case, precedence is already challenging enough, and the parens help clarify. with the spaces, you add another dimension of uncertainty and possible confusion
08:21 masak ...unless of course your goal is to appear clever above being clear -- in which case, go right ahead :P
08:22 zakharyas joined #perl6
08:22 grondilu yeah, I admit I don't even know exactly what precedence make it work
08:22 grondilu but I hate parenthesis so much...
08:24 xtreak joined #perl6
08:25 masak you should use Forth or something ;)
08:26 grondilu lol I was think about it just after I wrote that
08:26 grondilu *thinking
08:27 masak or Brainfuck
08:27 grondilu :/
08:27 grondilu Forth is very respectable a language, don't mock it
08:28 masak not my intent to mock anything
08:29 masak just listing languages that don't parenthesize expressions
08:29 arnsholt Or just use lots and lots of intermediate variables =)
08:29 grondilu yeah but you went straight form Forth to Brainf*.  But nevermind
08:29 masak though I do believe both of those languages use `[` and `]` for delimiting things, so I guess it depends how far your aversion goes
08:30 masak grondilu: can you think of a third language? I'm curious.
08:30 masak grondilu: for what it's worth, I also admire Forth quite a bit
08:30 grondilu not one in mind, no.
08:30 masak then I feel less bad for mentioning those two together ;)
08:31 arnsholt I almost added Smalltalk, but it does parenthesise expressions. It's just invocations that are paren-less
08:32 masak I still remember (I think it was) nothingmuch who implemented a Forth in Haskell in the early Pugs days
08:32 masak think he called it "harrorth" or something
08:32 masak and his comment on Forth was that it was much deeper and more interesting than he had previously realized, and that his implementation didn't do it justice
08:32 masak or something to that effect
08:33 grondilu yeah, Forth is definitely cool
08:34 masak also, please don't mock Brainfuck :P it may not be a respectable language, but it's a very minimal Turing Tarpit, with emphasis on the "Turing"
08:34 arnsholt I'm a bit sceptical of stack based languages. But that's probably due to my only exposure to them being the BibTeX style language, which is a bit idiosyncratic
08:35 masak https://irclog.perlgeek.de/perl6/search/?nick=&amp;q=harrorth tells me I got the name of the language ("harrorth") right, as well as the author (nothingmuch)
08:36 masak but I can't archive.org from where I am, and the original link is dead
08:36 masak arnsholt: I think there is something genuinely interesting going on in the realm of typed stack-based languages, such as Cat and Kitten
08:36 masak I investigated that a little bit when I was toying with a hobby drawing language :)
08:37 arnsholt Oh, typed stack languages. That sounds delightfully mind-bending, actually =)
08:39 masak yeah
08:39 masak file it under "shows promise, but the mind-bending parts are problematic"
08:39 arnsholt =D
08:39 masak I remember something about "how do we represent a vararg on the stack?"...
08:45 arnsholt Heh
08:45 poska joined #perl6
08:48 dakkar joined #perl6
08:49 mr_ron joined #perl6
09:03 jonas1 joined #perl6
09:04 bjz joined #perl6
09:06 agentzh joined #perl6
09:09 BooK joined #perl6
09:11 bjz_ joined #perl6
09:14 salva joined #perl6
09:18 abraxxa joined #perl6
09:25 labster joined #perl6
09:25 labster joined #perl6
09:34 bjz joined #perl6
09:35 g4 joined #perl6
09:41 bjz_ joined #perl6
09:42 pmurias joined #perl6
09:42 xtreak joined #perl6
09:56 wolfram joined #perl6
09:58 wolfram Postscript is stack based and should work without parenthesing expressions -- but I don't know it too well
10:02 * TimToady says HI from HI
10:02 xtreak joined #perl6
10:08 andrzejku joined #perl6
10:14 bjz joined #perl6
10:16 ZzZombo joined #perl6
10:16 ZzZombo joined #perl6
10:18 pyrimidine joined #perl6
10:20 andrzejku hello :)
10:21 lukaramu joined #perl6
10:21 andrzejku yesterday Perl6 helped me to go sleep
10:21 andrzejku last night*
10:26 ggoebel joined #perl6
10:28 samcv :)
10:30 tharkun joined #perl6
10:37 astj joined #perl6
10:48 zengargoyle i miss me some Forth. it was my third language after TRS-80 Basic and Turbo Pascal. it was the only PD language for the Amiga at the time where you could get down into the guts of the OS.
10:52 salv0 joined #perl6
10:53 lizmat TimToady o/
10:54 andrzejku the intresting thing which I admit and someone show me last night here
10:54 andrzejku https://github.com/damaxi/Algorithm/blob/master/guess_number.p6
10:54 masak today's discussion about typed stack languages made me start dreaming again about my figure-drawing language :)
10:55 andrzejku this is faster ( $mid + $multiplier * (($high - $mid).abs / 2)).round(1) than $mid + $multiplier * (($high - $mid) div 2)
10:57 masak those are not the same, though. there's an .abs missing on the second one
10:57 masak what about `+> 1`, though? :)
10:57 mr-foobar joined #perl6
10:58 andrzejku +> 1?
10:58 masak m: say 11 +> 1
10:58 camelia rakudo-moar 80e0bc: OUTPUT: «5␤»
10:59 masak bit-shift to the right by 1 step
10:59 andrzejku oh okay I just checked it
10:59 masak I'm not entirely serious in proposing it
11:00 masak it feels like the kind of premature optimization that's evil almost by default
11:00 andrzejku masak, that was written on my Assembler book :)
11:05 astj joined #perl6
11:28 abraxxa joined #perl6
11:33 ZzZombo It appears I have incapable to understand what exactly is this make stuff and why it it needed. I'm trying to parse a grammar and make a data structure out of it for later use.
11:33 yoleaux 08:12Z <arnsholt> ZzZombo: I get 「 and 」 in PuTTY with Courier New, FWIW
11:34 timotimo ZzZombo: let me try to explain
11:34 timotimo you know how when you capture something in your regex like a <realsuperhero>?
11:34 ZzZombo IDK, I tried that as well, with chcp 65001 active, no effect/
11:35 ZzZombo timotimo: yes.
11:35 timotimo you can access the things the realsuperhero regex/token matched through $<realsuperhero>?
11:35 ZzZombo yup
11:35 pyrimidine joined #perl6
11:36 timotimo when you call "make" where you have the $/ that belongs to the realsuperhero regex (i.e. in the realsuperhero regex itself, or in an action method called realsuperhero), that will set the value of $<realsuperhero>.made
11:37 timotimo the action method will be called when a match has succeeded, and its most common task is to build a piece of the final datastructure and attach it to the match result using "make"
11:38 timotimo of course you're free to put the "make" as close towards the TOP as you want, and grab data from deeper submatches
11:38 moritz though the deeper you go, the more you couple the code to structure of the regexes
11:39 timotimo really, action methods is a way to spread out mostly self-contained chunks of "match tree to datastructure" code "closer to" where the match happens
11:39 timotimo yes, what moritz said
11:39 xtreak joined #perl6
11:39 tbrowder mornin #per6
11:40 ZzZombo say I have string 'a { b=z x { y=d} }', I have working grammar to parse that but I don't get how to make a data structure that reflects the given layout using action class.
11:42 timotimo the rule that's responsible for b=z would "make $<first>.Str => $<second>.Str" or "make [$<first>.Str, $<second>.Str]" or something like that
11:43 timotimo the rule that's responsible for "a { ... }" would do something like "make $<submatches>.map(*.made)"
11:43 tbrowder ref: p6 run command, the last several days i've been warned about possible dire consequences when allowing user strings to be inserted into the command. can anyone show a regex that would warn of all, or at least most, bad chars and char combos that would cause a problem?
11:44 ZzZombo yea, I got that one, but I don't see how to "attach" inner group into the root.
11:44 tbrowder would that be useful in the docs?
11:44 timotimo well, ideally you'd have a proto regex that'll match either a thing with a =, or a thing with { }
11:44 timotimo and you + that
11:45 timotimo so your $<theprotoregex> will contain all those matches, regardless of whether it's one of the = things or one of the { } things
11:45 timotimo and their .made will be a suitable thing to just put into the resulting list
11:46 ZzZombo hm... does it have to be a protoregex? Currently it's an alternating group like <key> <value> || <group>
11:47 timotimo doesn't have to
11:47 timotimo in that case your best bet is to put it into ( ), so that you have the ordering from that thing
11:48 timotimo and then you'd do something like $/.list.map({ $_<key> ?? $_<key>.Str => $_<value>.Str !! $<group>.made })
11:52 andrzejku is there something like perl6doc command?
11:53 ZzZombo hmm, you use just 'make stuff' but https://docs.perl6.org/language/grammars tells me to use '$/.make stuff'. Is it the same?
11:53 ranguard andrzejku: https://github.com/perl6/doc
11:54 andrzejku ranguard, mm? grep?
11:55 ranguard "p6doc -- an attempt to write something like 'perldoc' for Perl 6" - that not what you are after?
11:57 andrzejku :) p6doc?
12:04 Actualeyes joined #perl6
12:04 tojo joined #perl6
12:08 tojo my %hash = foo => 1;
12:08 tojo if %hash<a>:exists {
12:08 tojo say "not gonna print this";
12:08 tojo }
12:08 tojo my $key = 'b';
12:08 tojo if %hash«$key»:exists {
12:08 tojo say "why i'm here";
12:08 tojo }
12:08 tojo hey, can someone point me to right direction here? :)
12:09 masak m: my %hash = foo => 1; my $key = 'b'; if %hash«$key»:exists { say "why i'm here" }; say "alive"
12:09 camelia rakudo-moar 80e0bc: OUTPUT: «why i'm here␤alive␤»
12:09 masak huh.
12:09 masak I... I call bug.
12:10 masak m: my %hash = foo => 1; my $key = 'b'; if %hash«$key»:exists { say "why i'm here" }; say %hash.perl
12:10 camelia rakudo-moar 80e0bc: OUTPUT: «why i'm here␤{:foo(1)}␤»
12:10 tojo huh :D
12:18 tojo but ok :) i'll have to go around this then and issue bug report about this somewhere
12:18 tbrowder fancy quotes instead of braces?  didn't know that was permitted
12:18 masak tojo: email to rakudobug@perl.org
12:18 masak tojo: helps a lot of you just paste the backlog above into the email
12:19 masak especially my interaction with camelia, but also the rest helps as background
12:19 masak tbrowder: it's strangely consistent with q and qq, see :)
12:19 CIAvash[m] m: my %hash; my $key = 'a'; dd %hash«$key»
12:19 camelia rakudo-moar 80e0bc: OUTPUT: «(Any,)␤»
12:20 tojo masak: sure, i'll but all the info i have. thx!
12:24 masak de rien
12:25 tbrowder masak: ok, i guess i need to dive into that more. at any rate, i think that part oh hash docs probably could use some love...
12:26 tbrowder masak: any thoughts on a regex for checking run args before use?
12:27 timotimo m: my %hash; my $key = 'a'; dd %hash«$key»
12:27 camelia rakudo-moar 80e0bc: OUTPUT: «(Any,)␤»
12:27 timotimo m: my %hash; my $key = 'a'; dd %hash«$key»:exists
12:27 camelia rakudo-moar 80e0bc: OUTPUT: «(Bool::False,)␤»
12:27 timotimo m: my %hash; my $key = 'a'; dd %hash{$key}:exists; dd %hash{$key,}:exists
12:27 camelia rakudo-moar 80e0bc: OUTPUT: «Bool::False␤(Bool::False,)␤»
12:29 masak m: my %hash; my $key = 'a'; say so %hash«$key»:exists
12:29 camelia rakudo-moar 80e0bc: OUTPUT: «True␤»
12:29 masak m: say so (False,)
12:29 camelia rakudo-moar 80e0bc: OUTPUT: «True␤»
12:29 masak there we go
12:29 timotimo m: my %hash; my $key = 'a'; say all %hash«$key»:exists
12:29 camelia rakudo-moar 80e0bc: OUTPUT: «all(False)␤»
12:29 timotimo m: my %hash; my $key = 'a'; say so all %hash«$key»:exists
12:29 camelia rakudo-moar 80e0bc: OUTPUT: «False␤»
12:29 masak a list of one False element boolifies to True
12:29 timotimo of course
12:30 masak but why would %hash<a> be an item while %hash«$key» is a list?
12:30 timotimo yeah, that's the bug
12:30 masak aye
12:30 timotimo m: my $key = "a"; dd «$key»
12:30 camelia rakudo-moar 80e0bc: OUTPUT: «slip("a",)␤»
12:30 timotimo is it meant to be like this?
12:30 kurahaupo joined #perl6
12:31 timotimo committable6: release my $key = "a"; dd «$key»
12:31 committable6 timotimo, ¦«release»: Cannot find this revision (did you mean “Prague”?)
12:31 timotimo committable6: releases my $key = "a"; dd «$key»
12:31 masak m: dd <a>
12:31 camelia rakudo-moar 80e0bc: OUTPUT: «"a"␤»
12:31 committable6 timotimo, ¦«2015.12,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07.1,2016.08.1,2016.09,2016.10,2016.11,2016.12,2017.01,HEAD»: slip("a",)
12:31 masak I would expect «$key» to eval to "a" also, I think
12:31 timotimo well, that part has been like that forever at least
12:33 masak I can see how that might have happened
12:33 cibs joined #perl6
12:33 masak I mean, «» isn't something one'd reach for if one wanted just a string
12:34 masak because %hash{$key} would work just as well
12:34 timotimo right
12:35 timotimo though when you've started with using < > everywhere and then get told "«» is the interpolating variant of < >", i can see why you'd reach « » instead of { }
12:36 masak aye
12:44 robertle joined #perl6
12:44 cibs joined #perl6
12:45 abraxxa is there a module for html parsing which supports css selectors?
12:45 abraxxa I'm using Web::Query::LibXML in Perl 5 for that
12:50 effbiai joined #perl6
12:50 effbiai joined #perl6
12:50 pyrimidine joined #perl6
12:53 timotimo so should we be slipping the one element, realize that it's just one element, and just return a single value instead?
12:53 abraxxa and which http client module is recommended?
12:58 ZzZombo m: class A::B { has $.r; method a { $.r='x' } };my $a=A::B.new;$a.a;
12:58 camelia rakudo-moar 80e0bc: OUTPUT: «Cannot modify an immutable Any␤  in method a at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:59 timotimo you need either "has $.r is rw" or access $!r from inside method a
12:59 ZzZombo m: class A::B { has $.r; method a { $!r='x' } };my $a=A::B.new;$a.a;
12:59 camelia rakudo-moar 80e0bc: ( no output )
12:59 tbrowder abraxxa: gfldex recommends his HTTP::Client
13:01 abraxxa tbrowder: ok. what about HTTP::UserAgent?
13:02 * abraxxa likes how zef installs are atomic, one module fails, none of the deps stays installed
13:02 ZzZombo "Cannot look up attributes in a Grammar::VDF::Actions type object"
13:02 ZzZombo ??
13:03 moritz instantiate it?
13:03 ZzZombo $/.make($!root=$<section>.made); <- this is the origin of the error, if I remove $!root=
13:03 ZzZombo it works
13:03 timotimo yeah, pass :actions(Grammar::VDF::Actions.new)
13:03 ZzZombo k
13:03 timotimo i mean, in the .parse call
13:04 ZzZombo works, thanks
13:04 CIAvash[m] abraxxa: there is Dom::Tiny, but I haven't used it https://github.com/zostay/p6-DOM-Tiny/blob/master/lib/DOM/Tiny.pm6
13:05 timotimo is that the Valve Data Format?
13:10 abraxxa they all seem to assume internet connectivity for testing
13:11 abraxxa CIAvash[m]: thanks, missed that one on modules.perl6.org
13:13 ZzZombo what is the XX operator?
13:13 timotimo it's for betraying folks
13:13 timotimo we call it "the double-cross"
13:14 timotimo m: say [[1, 2], <a b>] XX [[9, 8], <x y>]
13:14 camelia rakudo-moar 80e0bc: OUTPUT: «((([1 2] [9 8])) (([1 2] (x y))) (((a b) [9 8])) (((a b) (x y))))␤»
13:14 timotimo m: say [[1, 2], <a b>] XX [[9, 8], <x y>
13:14 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in array composer; couldn't find final ']' ␤at <tmp>:1␤------> 3say [[1, 2], <a b>] XX [[9, 8], <x y>7⏏5<EOL>␤    expecting any of:␤        statement end␤        …»
13:14 timotimo oops
13:14 timotimo m: say [(1, 2), <a b>] XX ((9, 8), <x y>)
13:14 camelia rakudo-moar 80e0bc: OUTPUT: «((((1 2) 9) ((1 2) 8)) (((1 2) x) ((1 2) y)) (((a b) 9) ((a b) 8)) (((a b) x) ((a b) y)))␤»
13:15 timotimo that's what i meant to do the first time
13:15 timotimo no, actually
13:15 timotimo m: say ((1, 2), <a b>) XX ((9, 8), <x y>)
13:15 camelia rakudo-moar 80e0bc: OUTPUT: «(((1 9) (1 8) (2 9) (2 8)) ((1 x) (1 y) (2 x) (2 y)) ((a 9) (a 8) (b 9) (b 8)) ((a x) (a y) (b x) (b y)))␤»
13:15 sergot does anyone know if Perl Foundation participates in GSoC this year? :)
13:15 yoleaux 19 Jan 2017 11:29Z <kalkin-> sergot: can you please glance at io-socket-ssl/#17? any hints how I can fix this issue and submit a PR back would be great!
13:15 yoleaux 19 Jan 2017 12:33Z <kalkin-> sergot: never mind my previous message. my bad
13:15 timotimo sergot: i think nobody volunteered to do the necessary work? and now it's too late i believe
13:16 sergot timotimo: yes, the deadline was 9th of February iirc
13:18 sergot :(
13:20 IOninja m: dd «a»
13:20 camelia rakudo-moar 80e0bc: OUTPUT: «"a"␤»
13:20 IOninja m: my $x = "a"; dd «$x»
13:20 camelia rakudo-moar 80e0bc: OUTPUT: «slip("a",)␤»
13:20 rurban joined #perl6
13:21 IOninja m: my $x = "a"; dd «$x $x»
13:21 camelia rakudo-moar 80e0bc: OUTPUT: «("a", "a")␤»
13:25 masak IOninja: looking at the above, I can't swear that the bug isn't a feature after all
13:26 * IOninja tries to parse the double negative...
13:27 cale2 joined #perl6
13:27 IOninja You swear it's a feature?
13:27 jnthn m: say <<foo>>.WHAT
13:27 camelia rakudo-moar 80e0bc: OUTPUT: «(Str)␤»
13:27 tbrowder abraxxa: i haven't actually tried either client yet, i'm going with gfldex's rec, and it should handle https, most important to my need, can't say about other client.  also UI looks like style i like.
13:27 ZzZombo <timotimo> and then you'd do something like $/.list.map({ $_<key> ?? $_<key>.Str => $_<value>.Str !! $<group>.made })
13:27 jnthn m: my $foo = 'x'; say <<$foo>>.WHAT
13:27 camelia rakudo-moar 80e0bc: OUTPUT: «(Slip)␤»
13:27 jnthn m: my $foo = 'x'; say <<$foo>>.perl
13:27 camelia rakudo-moar 80e0bc: OUTPUT: «slip("x",)␤»
13:27 jnthn m: my $foo = 'x y'; say <<$foo>>.perl
13:27 camelia rakudo-moar 80e0bc: OUTPUT: «slip("x", "y")␤»
13:27 timotimo that's what i said, yeah
13:27 ZzZombo apparently .list() returns ().
13:28 ZzZombo what do
13:28 abraxxa tbrowder: it works nicely, only the tests assume internet connectivity
13:28 timotimo what does your regex look like?
13:28 jnthn m: my $foo = 'x'; say <<"$foo">>.perl
13:28 camelia rakudo-moar 80e0bc: OUTPUT: «"x"␤»
13:28 abraxxa DOM::Tiny fails some tests, force-installing it now
13:28 lichtkind joined #perl6
13:28 IOninja oh heh
13:28 timotimo oh, wait, you want $/[0].list probably
13:28 ZzZombo token key-value { <name>\h+<value> }
13:28 ZzZombo rule section { <(<name> '{' [<key-value> || <section>]* '}')> [\n || $] }
13:28 cale2 m: ^200.pick.say
13:28 camelia rakudo-moar 80e0bc: OUTPUT: «Potential difficulties:␤    Precedence of ^ is looser than method call; please parenthesize␤    at <tmp>:1␤    ------> 3^2007⏏5.pick.say␤WARNINGS for <tmp>:␤Useless use of "^" in expression "^200.pick.say" in sink context (line 1)␤200␤»
13:28 jnthn The thing about <<$x>> is that we cannot tell - syntactically - how many elements it's going to produce
13:28 jnthn Because we split the interpolated thing on whitespace
13:29 timotimo ah
13:29 IOninja m: ^200 .pick.say
13:29 camelia rakudo-moar 80e0bc: OUTPUT: «10␤»
13:29 jnthn Notice how where we can, in <<"$x">>, we do indeed give back a Str
13:29 timotimo i told you to put it into ( ) and + that
13:29 timotimo you have [ ] and * - please use ( ) and * instead
13:29 abraxxa would be nice to make zef ask if a module should be installed anyways on test failure to not have to run all tests again
13:29 mr_ron joined #perl6
13:29 IOninja abraxxa: --force
13:29 abraxxa IOninja: yes, for another run
13:29 ZzZombo whoops
13:29 IOninja abraxxa: --/test (or --/tests)
13:30 IOninja m: my $foo = 'x y'; say <<$foo $foo>>.perl
13:30 camelia rakudo-moar 80e0bc: OUTPUT: «("x", "y", "x", "y")␤»
13:30 jnthn And if you want to argue that <<$x>> should return Str when it can, and Slip when it can't, then just think how much more confusing it'll be when `if %h<<$x>>:exists { }` suddenly becomes true because $x contains whitespce. :-)
13:30 IOninja :)
13:30 IOninja Yeah, makes sense in that framing
13:31 lukiramu joined #perl6
13:33 IOninja Seems it's always true
13:33 IOninja m: my %h = :42a, :72b; my $x = 'z'; if %h<<$x>>:exists { say "hi"}
13:33 camelia rakudo-moar 80e0bc: OUTPUT: «hi␤»
13:33 IOninja m: my %h = :42a, :72b; my $x = 'a b'; if %h<<$x>>:exists { say "hi"}
13:33 camelia rakudo-moar 80e0bc: OUTPUT: «hi␤»
13:33 IOninja m: my %h = :42a, :72b; my $x = 'y z'; if %h<<$x>>:exists { say "hi"}
13:33 camelia rakudo-moar 80e0bc: OUTPUT: «hi␤»
13:34 jnthn Right, 'cus it always returns a non-empty list
13:34 IOninja huh
13:34 jnthn m: my %h = :42a, :72b; my $x = 'z'; if %h<<"$x">>:exists { say "hi"}
13:34 camelia rakudo-moar 80e0bc: ( no output )
13:34 IOninja m: my %h = :42a, :72b; my $x = 'y'; dd %h<<$x>>
13:34 camelia rakudo-moar 80e0bc: OUTPUT: «(Any,)␤»
13:34 jnthn m: say so(False,)
13:34 camelia rakudo-moar 80e0bc: OUTPUT: «False␤»
13:34 IOninja oh lol
13:35 IOninja m: say so (False,)
13:35 camelia rakudo-moar 80e0bc: OUTPUT: «True␤»
13:35 jnthn That's what I wnated :)
13:36 perlpilot joined #perl6
13:37 abraxxa what are I'm doing wrong here? my @pdf-uris = $dom.find('a[href$="pdf"]').map(URI.new(*.attr('href')));
13:37 abraxxa without the URI.new it works
13:37 timotimo you're passing a WhateverCode to URI.new, is that what you want?
13:37 timotimo and you're calling that URI instance with everything in the result of .find
13:38 jnthn Probably meant .map({ URI.new(.attr('href')) }) or so
13:38 abraxxa I want to return URI objects instead of Str
13:38 IOninja what jnthn said.
13:38 jnthn Whatever-currying doesn't happen inside of argument lists
13:38 abraxxa that works and is easier to understand, thanks
13:38 jnthn It has to be at the top level
13:39 IOninja .map: *.attr('href').&{URI.new: $_}; # Fight the Man
13:40 abraxxa wuhhahhaa
13:40 timotimo yup
13:40 abraxxa that's even more confusin
13:40 abraxxa confusing
13:40 abraxxa having a block which is called per element is easier to grasp
13:41 abraxxa URI's absolute and relative methods are deprecated
13:41 IOninja abraxxa: I wouldn't recommend using that. It'll croak on many real-world URLs
13:42 IOninja <a href="http://foo.bar/whoops a space"></a> <--- try that one
13:42 timotimo or data: urls
13:43 IOninja <a href="http://foo.bar/?I♥u"></a> # that'll choke it too IIRC
13:43 IOninja Basically anything that doesn't conform to the spec... and since when web developers rigidly followed the spec :)
13:44 abraxxa my goal is to either set the absolute url from the fetched page if the links on it are relative
13:45 IOninja Yup, throws on both of my examples.
13:45 araraloren joined #perl6
13:46 IOninja Mojo::URL:from<Perl5> is pretty good when it comes to Real World™ URLs
13:46 abraxxa this is just a simple script to show the weekly menu pdf ;)
13:46 abraxxa it currently has absolute URIs but had relative in the past
13:57 ZzZombo difference between .append and .push for Hash?
13:59 masak m: for "append", "push" -> $method { my @a = 1, 2, 3; @a."$method"([4, 5]); say @a.perl }
13:59 camelia rakudo-moar 80e0bc: OUTPUT: «[1, 2, 3, 4, 5]␤[1, 2, 3, [4, 5]]␤»
13:59 masak ZzZombo: ^
13:59 IOninja that's not a Hash...
13:59 masak oh, for Hash!
13:59 IOninja :)
13:59 IOninja s: %, 'append'
13:59 SourceBaby IOninja, Sauce is at https://github.com/rakudo/rakudo/blob/80e0bce/src/core/Hash.pm#L282
13:59 IOninja s: %, 'push'
13:59 SourceBaby IOninja, Sauce is at https://github.com/rakudo/rakudo/blob/80e0bce/src/core/Hash.pm#L255
14:00 IOninja Ahhhh
14:00 masak not sure what those two methods even do on Hash, to be honest
14:01 IOninja m: my %h = :a[42, ]; %h.push: "a" => <a b c a>; dd %h
14:01 camelia rakudo-moar 80e0bc: OUTPUT: «Hash %h = {:a($[42, ("a", "b", "c", "a")])}␤»
14:01 IOninja m: my %h = :a[42, ]; %h.append: "a" => <a b c a>; dd %h
14:01 camelia rakudo-moar 80e0bc: OUTPUT: «Hash %h = {:a($[42, "a", "b", "c", "a"])}␤»
14:01 IOninja ZzZombo: ^
14:01 masak Perl 6 is weird :P
14:01 ZzZombo welp
14:02 IOninja Yeah, existence of these is pretty weird
14:02 IOninja And their impl is 99% identical; and both use helper methods whose impl is 99% identical :P
14:05 IOninja Man, this stuff's documented too, ZzZombo
14:06 jnthn They're useful if you're aggregating values by hash key
14:06 ZzZombo I couldn't find the difference just by looking at the docs.
14:06 IOninja You can type the routine name in the search box and then click on it and scroll to the type in question.
14:07 ZzZombo <ZzZombo> I couldn't find the difference just by looking at the docs.
14:08 IOninja yeah
14:08 IOninja fixing it
14:09 tbrowder abraxxa: hm, can't help there, maybe cobble together yr own local server for testing
14:09 ZzZombo ===SORRY!===
14:09 ZzZombo Type Array does not support associative indexing.
14:09 ZzZombo ugh, how helpful.
14:09 ZzZombo Where is that exactly?
14:11 IOninja buggable: 8ball where is that exactly?
14:12 IOninja ZzZombo: we can't make it more helpful without knowing of the issue. Report such errors.
14:12 IOninja huggable: rakudobug
14:12 huggable IOninja, Report bugs by emailing to rakudobug@perl.org
14:13 ZzZombo I'm still investigating.
14:14 mcmillhj joined #perl6
14:17 Geth ¦ doc: 611d6d24f3 | (Zoffix Znet)++ | doc/Type/Hash.pod6
14:17 Geth ¦ doc: Include difference between Hash.append/Hash.push
14:17 Geth ¦ doc:
14:17 Geth ¦ doc: https://irclog.perlgeek.de/perl6/2017-02-21#i_14137771
14:17 Geth ¦ doc: review: https://github.com/perl6/doc/commit/611d6d24f3
14:20 IOninja m: my @a = lazy (); say WHAT @a.pop
14:20 camelia rakudo-moar 80e0bc: OUTPUT: «(Failure)␤»
14:20 IOninja m: my @a = lazy (); say WHAT @a.shift
14:20 camelia rakudo-moar 80e0bc: OUTPUT: «(Failure)␤»
14:20 IOninja m: my @a = lazy (); say WHAT @a.push: 42
14:20 camelia rakudo-moar 80e0bc: OUTPUT: «Cannot push to a lazy list␤  in block <unit> at <tmp> line 1␤␤»
14:20 IOninja inconsistent...
14:21 agentzh joined #perl6
14:22 cdg joined #perl6
14:22 cdg joined #perl6
14:23 Geth ¦ doc: b6a1b5ddc5 | (Zoffix Znet)++ | doc/Type/Array.pod6
14:23 Geth ¦ doc: Use more precice language / Mention Array.append throwage
14:23 Geth ¦ doc:
14:23 Geth ¦ doc: ...on lazy arrays
14:23 Geth ¦ doc: review: https://github.com/perl6/doc/commit/b6a1b5ddc5
14:23 skids joined #perl6
14:24 IOninja m: []<42>
14:24 camelia rakudo-moar 80e0bc: OUTPUT: «Type Array does not support associative indexing.␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
14:25 IOninja m: BEGIN []<42>
14:25 camelia rakudo-moar 80e0bc: ( no output )
14:25 IOninja huh?
14:25 IOninja m: say BEGIN []<42>
14:25 camelia rakudo-moar 80e0bc: OUTPUT: «===SORRY!===␤Type Array does not support associative indexing.␤»
14:25 geekosaur joined #perl6
14:26 IOninja m: constant x = []<42>; say x
14:26 camelia rakudo-moar 80e0bc: OUTPUT: «===SORRY!===␤Type Array does not support associative indexing.␤»
14:26 IOninja ZzZombo: it's probably somewhere in that area ^
14:27 IOninja trying to take an assoc index from an array at compile time
14:27 bwisti joined #perl6
14:28 rurban I stumbled over the LINK phaser, but don;t see any implementation or usage. Is LINK still valid?
14:29 IOninja m: constant %h = :42a; %h.^name.say
14:29 camelia rakudo-moar 80e0bc: OUTPUT: «Pair␤»
14:29 ZzZombo well, I commented out some lines temporarily, since I have more pressing concerns. https://gist.github.com/ZzZombo/5caa51f9b238462d628a5b556920a0d8, I can't make this to work, how do I parse anything via grammars and shape a data structure to follow the parsed thing?
14:29 IOninja Because of course it's a Pair -_-
14:29 IOninja rurban: never heard of it. Where did you stumble on it?
14:30 rurban https://docs.perl6.org/language/phasers
14:30 rurban Must have been a very early design. nqp doesnt have it, or not yet
14:30 IOninja rurban: don't see it anywhere in the sauce, or specification.
14:30 rurban https://docs.perl6.org/language/phasers#LINK
14:31 IOninja I mean in rakudo's source
14:31 jnthn I think it was speculated in response to some discussion or other; the git history of the design docs may have some background.
14:31 rurban It's nowhere. If it would be in nqp src/NQP/Actions.nqp
14:31 [Coke] that text is directly lifted from https://design.perl6.org/S04.html, btw.
14:32 [Coke] We should remove it from the doc site.
14:32 IOninja way ahead of you
14:32 [Coke] IOninja++ rurban++
14:33 rurban Because I want to finalize cperl phases, and this sounded odd.
14:33 jnthn It doesn't make clear what it thinks of as link time, though, nor what it thinks it is for
14:33 jnthn (Or what problems it would solve)
14:33 Geth ¦ doc: 5c85fdd331 | (Zoffix Znet)++ | doc/Language/phasers.pod6
14:33 Geth ¦ doc: Remove LINK phaser
14:33 Geth ¦ doc:
14:33 Geth ¦ doc: grep -FR 'LINK' in rakudo and roast repos turn up nothing
14:33 Geth ¦ doc: review: https://github.com/perl6/doc/commit/5c85fdd331
14:35 rurban Don't you want to ask Larry first?
14:35 jnthn Not for removing from docs :)
14:35 pyrimidine joined #perl6
14:35 IOninja rurban: we don't document things that aren't part of Perl 6 Language.
14:35 jnthn Docs are meant to cover what's implemented.
14:35 IOninja Not on that site at least.
14:37 [Coke] also: @Larry, not $Larry
14:37 rurban Where is S04?
14:37 IOninja rurban: http://design.perl6.org/S04.html
14:38 rurban ah, specs
14:38 IOninja speculations are they're now called :}
14:39 jnthn (To be clear, the point here being that the test suite is the language specification, not a set of documents.)
14:39 rurban I see. LINK was called FINAL until 2014
14:40 rurban larry said 2014: s/FINAL/LINK/ for clarity. We don't want people confusing this with any other kind of finalization
14:41 rurban And he created FINAL in 2013: FINAL phase is after the main application's CHECK phase,
14:41 rurban when the application as a whole commits to optimization policies.
14:41 rurban In other words, a FINAL block defined in a module is not run when the
14:41 rurban module is compiled (that would be a CHECK instead), but rather when the
14:41 rurban application using the module is completing its compilation and linking
14:42 sena_kun joined #perl6
14:42 IOninja intresting..
14:42 IOninja never heard of term "linking" used in Perl 6
14:42 rurban So it will be eventually in, with more optimizations (~LTO)
14:43 rurban inlining and whole program optimizations. like use oo :final. which is also not in yet
14:43 lichtkind_ joined #perl6
14:44 jnthn Part of the lack of hurry on that being that we do inlining across compilation units already even without that pragma.
14:44 rurban So I keep it reserved. in cperl it would be a number, not a string. that's why I have to think forward.
14:45 rurban jnthn: it's just a hook, probably not needed for a long time
14:45 jnthn Sure
14:46 itaipu joined #perl6
14:46 rurban AFGAIK larry wanted ISA finalization be controlled by the app, not the module, so he needed that phase.
14:46 jnthn Just to be clear: back in 2013 it surely wasn't clear that you could sensibly assume deoptimization would be a possibility. In reality, all of the JVM, MoarVM, and v8 do it.
14:46 cale2 m: my @evens = $_ if .even for ^25; say @evens;
14:46 camelia rakudo-moar 80e0bc: OUTPUT: «No such method 'even' for invocant of type 'Int'␤  in block <unit> at <tmp> line 1␤␤»
14:47 jnthn Once you can deopt, the incentive to declare things like `use oo :final` is greatly reduced.
14:47 cale2 m: my @evens = $_ if $_ %% 2 for ^25; say @evens;
14:47 camelia rakudo-moar 80e0bc: OUTPUT: «[24]␤»
14:47 cale2 m: my @evens = $_ if $_ %% 2 for ^25; say @evens[];
14:47 camelia rakudo-moar 80e0bc: OUTPUT: «[24]␤»
14:47 jnthn Since you just speculatively inline whatever fits
14:47 rurban like smalltalk, yes
14:47 rurban or v8
14:48 jnthn Yes, the question is what modern runtimes we might wish to target *don't* do it?
14:49 IOninja cale2: you keep assigning a value to the array anew each time, so at the end you have just 24 in it, which is the last value you iterated over.
14:49 rurban I went ahead with more class finalizations, to enable compile-time ISA optimizations, and detect typos in methods and fields.
14:49 IOninja m: my @a = ^25 .grep: * %% 2; say @a
14:49 camelia rakudo-moar 80e0bc: OUTPUT: «[0 2 4 6 8 10 12 14 16 18 20 22 24]␤»
14:49 wamba1 joined #perl6
14:49 rurban But I have no numbers on that yet
14:50 cale2 IOninja: I'm trying to figure out how to achieve list comprehensions in P6
14:51 IOninja m: my @a = 0, 2 … * < 25; say @a
14:51 camelia rakudo-moar 80e0bc: OUTPUT: «[0]␤»
14:51 IOninja wat
14:51 IOninja m: my @a = (0, 2 … * < 25); say @a
14:51 camelia rakudo-moar 80e0bc: OUTPUT: «[0]␤»
14:51 jnthn m: say ($_ if $_ %% 2 for ^10)
14:51 camelia rakudo-moar 80e0bc: OUTPUT: «(0 2 4 6 8)␤»
14:51 arnsholt 0 is less than 25, no?
14:51 IOninja oh right
14:51 arnsholt =)
14:51 IOninja m: my @a = 0, 2 … * > 25; say @a
14:51 camelia rakudo-moar 80e0bc: OUTPUT: «[0 2 4 6 8 10 12 14 16 18 20 22 24 26]␤»
14:51 IOninja :)
14:51 IOninja cale2: no idea what list comprehemensions are.
14:52 arnsholt A list comprehension would usually be realized as a map in Perl (5 & 6)
14:52 jnthn IOninja: It's the name given to the syntax I just showed :)
14:52 jnthn Or so I thought ;-)
14:52 jnthn Basiaclly, (<transform> if <condition> for <list>)
14:52 IOninja Ah
14:52 arnsholt Oh, right. For loops are list-valued in 6, which gives the syntax jnthn gave
14:52 cale2 m: say $_ if $_ %% 2 for ^10
14:52 camelia rakudo-moar 80e0bc: OUTPUT: «0␤2␤4␤6␤8␤»
14:53 Resol joined #perl6
14:53 cale2 m: say ($_ if $_ %% 2 for ^10)
14:53 camelia rakudo-moar 80e0bc: OUTPUT: «(0 2 4 6 8)␤»
14:53 cale2 m: my @array = ($_ if $_ %% 2 for ^10); say @array[]
14:53 camelia rakudo-moar 80e0bc: OUTPUT: «[0 2 4 6 8]␤»
14:54 IOninja m: my @a = 0, 2 … * == 24; say @a
14:54 camelia rakudo-moar 80e0bc: OUTPUT: «[0 2 4 6 8 10 12 14 16 18 20 22 24]␤»
14:54 IOninja m: my @a = 0, 2 … 24; say @a
14:54 camelia rakudo-moar 80e0bc: OUTPUT: «[0 2 4 6 8 10 12 14 16 18 20 22 24]␤»
14:54 IOninja magic \o/
14:55 Resol_ joined #perl6
14:56 IOninja m: say 1, 3, 9 … 243
14:56 camelia rakudo-moar 80e0bc: OUTPUT: «(1 3 9 27 81 243)␤»
14:57 IOninja fancy pants
14:57 IOninja m: say 1, 3 … 243
14:57 camelia rakudo-moar 80e0bc: OUTPUT: «(1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 …»
14:57 zengargoyle joined #perl6
14:57 cale2 would you be able to do a list comprehension type thing for maps?
14:57 cale2 hashes I mean
14:58 cibs joined #perl6
14:58 IOninja m: my %h = ($_ if $_ %% 2 for ^12); dd %h
14:58 camelia rakudo-moar 80e0bc: OUTPUT: «Hash %h = {"0" => 2, "4" => 6, "8" => 10}␤»
14:59 arnsholt m: my %h = ($_ => $_*2 for ^4); dd %h # Should also work, IIRC
14:59 camelia rakudo-moar 80e0bc: OUTPUT: «Hash %h = {"0" => 0, "1" => 2, "2" => 4, "3" => 6}␤»
15:00 cale2 m: say 2.even
15:00 camelia rakudo-moar 80e0bc: OUTPUT: «No such method 'even' for invocant of type 'Int'␤  in block <unit> at <tmp> line 1␤␤»
15:00 cale2 m: say 2.odd
15:00 camelia rakudo-moar 80e0bc: OUTPUT: «No such method 'odd' for invocant of type 'Int'␤  in block <unit> at <tmp> line 1␤␤»
15:00 IOninja m: say 2 %% 0
15:00 camelia rakudo-moar 80e0bc: OUTPUT: «Attempt to divide 2 by zero using infix:<%%>␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
15:00 IOninja m: say 2 %% 2
15:00 camelia rakudo-moar 80e0bc: OUTPUT: «True␤»
15:00 IOninja m: say 2 !%% 2
15:00 camelia rakudo-moar 80e0bc: OUTPUT: «False␤»
15:01 arnsholt (The %% operator being the nice way to write "(x % y) == 0")
15:02 IOninja m: say (5, -5, 5 … *)[^20]
15:02 camelia rakudo-moar 80e0bc: OUTPUT: «(5 -5 5 -5 5 -5 5 -5 5 -5 5 -5 5 -5 5 -5 5 -5 5 -5)␤»
15:02 IOninja That's so cool.
15:06 cale2 m: my @tuples = (1,2) xx 1..4; say @tuples[]
15:06 camelia rakudo-moar 80e0bc: OUTPUT: «[1 2 3 4]␤»
15:06 Actualeyes joined #perl6
15:07 cale2 m: my @tuples = (1,2) Z 1..4; say @tuples[]
15:07 camelia rakudo-moar 80e0bc: OUTPUT: «[(1 1) (2 2)]␤»
15:07 cale2 m: my @tuples = (1,2) X 1..4; say @tuples[]
15:07 camelia rakudo-moar 80e0bc: OUTPUT: «[(1 1) (1 2) (1 3) (1 4) (2 1) (2 2) (2 3) (2 4)]␤»
15:08 IOninja m: say (1/1, 1/3, 1/9 … ∞)[^12]».perl
15:08 camelia rakudo-moar 80e0bc: OUTPUT: «(1.0 <1/3> <1/9> <1/27> <1/81> <1/243> <1/729> <1/2187> <1/6561> <1/19683> <1/59049> <1/177147>)␤»
15:08 IOninja w00t
15:10 petercommand joined #perl6
15:10 IOninja m: say (1, *.is-prime … ∞)[^12]
15:10 camelia rakudo-moar 80e0bc: OUTPUT: «(1 False False False False False False False False False False False)␤»
15:10 IOninja Booo. Didn't do what I wanted. Perl 6 sucks.
15:12 IOninja m: say ("a", *.succ.uc, *.succ.lc … ∞)[^12]
15:12 camelia rakudo-moar 80e0bc: OUTPUT: «(a B C D E F G H I J K L)␤»
15:12 IOninja Hm, I don't fully grok this thing yet...
15:13 IOninja m: say (1, { $_ .= succ until .is-prime } … ∞)[^12]
15:13 camelia rakudo-moar 80e0bc: OUTPUT: «No such method 'is-prime' for invocant of type 'Any'␤  in block <unit> at <tmp> line 1␤␤»
15:13 IOninja How u do dis?
15:14 IOninja m: say (1, { repeat { $_ .= succ } until .is-prime; $_ } … ∞)[^12]
15:14 camelia rakudo-moar 80e0bc: OUTPUT: «(1 2 3 5 7 11 13 17 19 23 29 31)␤»
15:14 IOninja \o/
15:16 ZzZombo_ joined #perl6
15:17 IOninja m: say (1, { (($^v^..∞).grep: *.is-prime)[0] } … ∞)[^12]
15:17 camelia rakudo-moar 80e0bc: OUTPUT: «(1 2 3 5 7 11 13 17 19 23 29 31)␤»
15:21 araraloren joined #perl6
15:28 IOninja m: say "Ⅳ".Int
15:28 camelia rakudo-moar 80e0bc: OUTPUT: «Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5Ⅳ' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
15:29 IOninja what is the thing were're supposed to use to get the number?
15:29 IOninja m: &unival
15:29 camelia rakudo-moar 80e0bc: OUTPUT: «WARNINGS for <tmp>:␤Useless use of &unival in sink context (line 1)␤»
15:29 IOninja m: say unival "Ⅳ"
15:29 camelia rakudo-moar 80e0bc: OUTPUT: «4␤»
15:29 IOninja cool
15:29 IOninja m: say ("Ⅰ" ... *)[^20]
15:29 camelia rakudo-moar 80e0bc: OUTPUT: «(Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ Ⅺ Ⅻ ⅠⅠ ⅠⅡ ⅠⅢ ⅠⅣ ⅠⅤ ⅠⅥ ⅠⅦ ⅠⅧ)␤»
15:29 IOninja m: say ("Ⅰ" ... *)[^20]».unival
15:29 camelia rakudo-moar 80e0bc: OUTPUT: «(1 2 3 4 5 6 7 8 9 10 11 12 1 1 1 1 1 1 1 1)␤»
15:30 IOninja 1s?
15:30 IOninja m: say ⅠⅧ
15:30 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Bogus postfix␤at <tmp>:1␤------> 3say Ⅰ7⏏5Ⅷ␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement modifier␤        st…»
15:30 IOninja m: say Ⅷ
15:30 camelia rakudo-moar 80e0bc: OUTPUT: «8␤»
15:30 IOninja m: say unival Ⅷ
15:30 camelia rakudo-moar 80e0bc: OUTPUT: «NaN␤»
15:30 IOninja Oh, now I get it. It's a multichar string
15:31 IOninja m: say ("Ⅰ" ... *)[^20]».&{.comb».unival.sum}
15:31 camelia rakudo-moar 80e0bc: OUTPUT: «(1 2 3 4 5 6 7 8 9 10 11 12 2 3 4 5 6 7 8 9)␤»
15:31 IOninja Roman digits r hrd
15:32 abraxxa joined #perl6
15:34 ZzZombo joined #perl6
15:35 IOninja m: say ({ (my \n = ++$) %% 15 ?? "FizzBuzz" !! n %% 3 ?? "Fizz" !! n %% 5 ?? "Buzz" !! n } … ∞)[^20]
15:35 camelia rakudo-moar 80e0bc: OUTPUT: «(1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 Fizz 19 Buzz)␤»
15:35 IOninja Wanted to do this one with sequence going in roman numerals :(
15:38 astj joined #perl6
15:40 IOninja m: say $_ %% Ⅴ*Ⅲ ?? 'Fizz Buzz' !! $_ %% Ⅲ ?? 'Fizz' !! $_ %% Ⅴ ?? 'Buzz' !! $_ for ^Ⅹ*Ⅹ
15:40 camelia rakudo-moar 80e0bc: OUTPUT: «Fizz Buzz␤1␤2␤Fizz␤4␤Fizz Buzz␤Fizz␤7␤8␤Fizz␤Fizz Buzz␤11␤Fizz␤13␤14␤Fizz Buzz␤16␤17␤Fizz␤19␤Fizz Buzz␤Fizz␤22␤23␤Fizz␤Fizz Buzz␤26␤Fizz␤28␤29␤Fizz Buzz␤31␤32␤Fizz␤34␤Fizz Buzz␤Fizz…»
15:40 IOninja ehe
15:40 ugexe .tell abraxxa it could be possible to make zef not re-test if you restart a previously failed run, i'm just not sure the best way to implement it
15:40 yoleaux ugexe: I'll pass your message to abraxxa.
15:40 abraxxa ugexe: i see
15:40 yoleaux 15:40Z <ugexe> abraxxa: it could be possible to make zef not re-test if you restart a previously failed run, i'm just not sure the best way to implement it
15:41 ugexe because usually a failed run means you want to rerun after some new command to fix the previous problem
15:41 eroux joined #perl6
15:42 ugexe so off the top of my head i can imagine it leaving some .dot-file as a marker, or passing something like --restart-run=$some-id-from-stderr
15:43 itcharlie1 joined #perl6
15:43 abraxxa ugexe: I was more thinking about a 'do you like to install it anyway?' in case of an interactive shell
15:44 ugexe I feel like I've been trying to avoid interactive stuff
15:44 [Coke] sena_kun: https://github.com/perl6/doc/pull/1207 is updated, more feedback welcome.
15:45 ugexe not that its wrong, but I'd like to expose it at a non-interactive level and possibly build the interactive bits on that
15:47 sena_kun [Coke], shouldn't we add IO::String to META.json?
15:48 abraxxa ugexe: understandable for me
15:52 sena_kun [Coke], except for missing dependency, you did an awesome job, in my opinion. After some tests I didn't notice any problems and the performance is very pleasant. I'm ready to merge it and fix META.json right now if needed. Does gfldex agreed?
15:56 rurban joined #perl6
15:58 IOninja Recall someone wanted to add a WhateverCode candidate to head? I found a neat version of that:
15:58 IOninja m: my @a = ^100-10; say |@a … *.is-prime
15:58 camelia rakudo-moar 80e0bc: OUTPUT: «(-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2)␤»
15:58 IOninja hehe :)
15:59 sena_kun About my yesterday roast-related question. I want to write some tests for :dba adverb, but it doesn't has its own section. Should I create a new file in modifiers section?
15:59 IOninja sena_kun: sure why not. Be sure to add it to https://github.com/rakudo/rakudo/blob/nom/t/spectest.data too, so it gets run
16:00 cibs joined #perl6
16:00 kurahaupo joined #perl6
16:00 cale2 could you make an `is pure` trait for subs and methods?
16:00 sena_kun IOninja, okay, let'ss see what I'm able to write! Thanks.
16:00 IOninja cale2: we already have it.
16:01 ugexe m: say await start { prompt "..." } # is there a way to do a prompt that has a timeout without nativecall yet?
16:01 camelia rakudo-moar 80e0bc: OUTPUT: «...»Wann treffen wir drei wieder zusamm?«␤»
16:02 IOninja Well, the above don't work. It'll throw the socket read from other thread thing
16:02 ugexe only if it gets assigned a different thread id!
16:03 IOninja Is it possible to force it to use the same thread id?
16:03 ugexe no, but...
16:03 IOninja ...
16:04 ugexe https://github.com/ugexe/Perl6-Net--HTTP/blob/master/lib/Net/HTTP/Transport.pm6#L70 you can try to reuse the thread as long as that error check itself thinks you're using the same thread id
16:04 cale2 IOninja: I see the docs now, thanks. But `is pure` is more about the final result. You can do all sorts of wacky things inside the function as long as the final result "is pure" I guess
16:04 Geth ¦ doc/coke/examples: 313c01a6e7 | Altai-man++ | META.info
16:04 Geth ¦ doc/coke/examples: Add IO::String dependency
16:04 Geth ¦ doc/coke/examples: review: https://github.com/perl6/doc/commit/313c01a6e7
16:05 ugexe e.g. you should be able to spam that prompt command and eventually get past the error check (although it might blow up further down the line)
16:06 IOninja that sounds... horrible :)
16:06 sena_kun cale2, I'm not a specialist in optimisations, but I doubt a bit that you will gain anything from such declaration(in performance and purity areas, at least).
16:06 ugexe because that error check protects you from something that doesn't work right half the time. but sometimes half the time is enough :)
16:07 cale2 sena_kun: but you could write a quickcheck type system that greps all of the "is pure" things and makes a million tests for all of them
16:08 sena_kun To properly use purity you need to ban '=' operator(at least in its common sense, not math-related sense). It it obviously non-impreative way.
16:08 sena_kun cale2, Test::Fuzz?
16:08 sena_kun cale2, fuzzing testing exists not for h* only.
16:09 IOninja Our `is pure` tells the compiler it can constant fold and the thing will be evaled at compile time.
16:09 pyrimidine joined #perl6
16:09 Geth ¦ doc: 1e1985c296 | Cale++ | doc/Language/haskell-to-p6.pod6
16:09 Geth ¦ doc: Add rough update of list comprehensions
16:09 Geth ¦ doc: review: https://github.com/perl6/doc/commit/1e1985c296
16:12 IOninja m: sub foo($x, $y) { $x**$y }; $ =+(foo(2, 200000) xx 400); say now - INIT now
16:12 camelia rakudo-moar 80e0bc: OUTPUT: «4.7638959␤»
16:12 IOninja m: sub foo($x, $y) is pure { $x**$y }; $ =+(foo(2, 200000) xx 400); say now - INIT now
16:12 camelia rakudo-moar 80e0bc: OUTPUT: «0.0015151␤»
16:12 IOninja m: say 4.7638959/0.0015151
16:12 camelia rakudo-moar 80e0bc: OUTPUT: «3144.278199␤»
16:14 Actualeyes left #perl6
16:17 itaipu joined #perl6
16:20 pyrimidine joined #perl6
16:20 ufobat_ i dont know what i am doing but is this a bug:
16:20 IOninja \o/
16:20 ufobat_ m: say EXPORTHOW.WHO.perl
16:20 camelia rakudo-moar 80e0bc: OUTPUT: «No such method 'WHICH' for invocant of type 'Perl6::Metamodel::CoercionHOW'␤  in block <unit> at <tmp> line 1␤␤»
16:21 IOninja heh
16:21 IOninja Don't think so.
16:21 IOninja Meta stuff is lowerlevel and doesn't have all the bells and whistles that normal types have
16:22 IOninja m: say EXPORTHOW.WHO.^methods».name.say
16:22 camelia rakudo-moar 80e0bc: OUTPUT: «(package_at_key merge-symbols AT-KEY gist Str name Hash AT-KEY STORE_AT_KEY ASSIGN-KEY categorize-list perl of classify-list gist Map BIND-KEY default DUMP clone keyof dynamic push WHICH append DELETE-KEY elems List iterator STORE STORE_AT_KEY Hash sort …»
16:22 IOninja m: say EXPORTHOW.WHO.^name.say
16:22 camelia rakudo-moar 80e0bc: OUTPUT: «Stash␤True␤»
16:23 IOninja m: say EXPORTHOW.WHO..say
16:23 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5===␤Argument to "say" seems to be malformed␤at <tmp>:1␤------> 3say EXPORTHOW.WHO..say7⏏5<EOL>␤Other potential difficulties:␤    Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an explicit i…»
16:23 IOninja m: say EXPORTHOW.WHO.say
16:23 camelia rakudo-moar 80e0bc: OUTPUT: «EXPORTHOW␤True␤»
16:23 IOninja m: Stash.perl
16:23 camelia rakudo-moar 80e0bc: ( no output )
16:23 IOninja m: Stash.new.perl
16:23 camelia rakudo-moar 80e0bc: ( no output )
16:23 * IOninja shrugs
16:24 ufobat_ well.. okay :-)
16:27 agentzh joined #perl6
16:27 IOninja m: (Int()).HOW.perl
16:27 camelia rakudo-moar 80e0bc: OUTPUT: «No such method 'perl' for invocant of type 'Perl6::Metamodel::CoercionHOW'␤  in block <unit> at <tmp> line 1␤␤»
16:27 IOninja m: (Int()).HOW.^methods».name.say
16:27 camelia rakudo-moar 80e0bc: OUTPUT: «(archetypes new_type name shortname target_type constraint_type delegate_methods_to delegating_methods_to pretend_to_be type_check find_method pretending_to_be CREATE bless BUILDALL new defined ACCEPTS isa)␤»
16:28 IOninja yeah, it's pretty barebones
16:30 ufobat_ what would you suggest to read in order to understand meta programming?
16:30 IOninja ufobat_: http://edumentab.github.io/rakudo-and-nqp-internals-course/
16:31 IOninja ufobat_: also, jnthn++ had a good article, but I won't be able to find it. Might've been one of the Advent articles from years back
16:31 ufobat_ yay :D thank you
16:31 IOninja ufobat_: well, I guess internals course is overkill, actually.
16:31 rurban joined #perl6
16:31 ufobat_ it wont hurt reading it, i guess :-)
16:32 IOninja But you do make a metaclass as part of it and it kinda clicks a bit
16:32 ufobat_ https://perl6advent.wordpress.com/2011/12/14/meta-programming-what-why-and-how/ <- do you mean this one?
16:32 IOninja Or you can look at the sauce of https://github.com/perl7/perl7
16:32 IOninja That's the meta class that does things: https://github.com/perl7/perl7/blob/master/src/perl7.nqp#L5-L23
16:33 IOninja ufobat_: hmm don't think so. It was a really long article
16:34 khw joined #perl6
16:36 IOninja crazy how many years some people have been here for... 5,8,10, or more
16:38 perlpilot "here" as in #perl6?
16:38 IOninja hehe: timotimo talking about being spoiled by python: https://irclog.perlgeek.de/perl6/2012-01-26#i_5052829
16:38 IOninja perlpilot: here as in "working on Perl 6"
16:38 cibs joined #perl6
16:38 ufobat_ IOninja, thanks for the tipps :-)
16:39 IOninja There's even a log of me offering help 10 years ago, saying I'm not good with perl lol: https://irclog.perlgeek.de/perl6/2007-07-25#i_69032
16:40 perlpilot Well, no one has been working on Perl 6 for more than 17 years  (except maybe Chip, but it wasn't called Perl 6 then)   :-)
16:40 IOninja Never heard of Chip
16:41 perlpilot Chip Salzenberg
16:42 IOninja "Perl's Chip Salzenberg Sued, Home Raided"
16:42 IOninja google headlines
16:42 perlpilot yeah, that sucked.
16:53 huf so what happened?
16:53 huf did he get sued into penury?
16:55 amalia__ joined #perl6
16:55 perigrin perlpilot: I think crystal or whatever it was called then was also very different
16:56 perlpilot Topaz
16:56 perlpilot yeah, it was something like the quickest Perl he could build with C++ or something
16:57 perigrin or even just an attempt to build a new perl5 VM in C++
16:58 perlpilot http://www.perl.com/pub/1999/09/topaz.html  (google++)
16:59 perigrin pretty sure the Real Audio link there won't work on my iPad
17:06 cale2 are grammars being backported into perl5?
17:07 perlpilot cale2: There's Perl6::Rules, but I suspect you mean more "natively".  If that's the case, I don't know and would ask p5p
17:09 perigrin no, nothing more native than what's on CPAN.
17:10 perigrin Also relevant are Damain's Regexp::Grammars
17:14 pyrimidine joined #perl6
17:15 mcmillhj joined #perl6
17:27 mcmillhj joined #perl6
17:30 cibs joined #perl6
17:35 sufrostico joined #perl6
17:37 gregf_ joined #perl6
17:39 eroux joined #perl6
17:45 mcmillhj joined #perl6
17:50 kalkin- joined #perl6
17:50 kalkin- hi
17:50 kalkin- how do I get pod from a package?
17:50 kalkin- Is there some magic access like Foo::Bar::.pod?
17:51 rurban joined #perl6
17:51 IOninja It's $= or $=pod or something or other
17:52 kalkin- IOninja: I thought $= is only available for the current scope
17:52 kalkin- I basically want to do say My::Module.pod();
17:53 IOninja m: package Foo { ␤=begin pod␤␤=head2 woot␤␤look, a pod!␤␤=end␤␤ }; say Foo::$=
17:53 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix = instead␤at <tmp>:8␤------> 3<BOL>7⏏5=end␤»
17:53 IOninja umm
17:53 IOninja Well, I don't even know how to write pod lol :)
17:56 IOninja m: package Foo { ␤=begin pod␤␤=head2 woot␤␤look, a pod!␤␤=end pod␤␤ }; say $=pod
17:56 camelia rakudo-moar 80e0bc: OUTPUT: «[Pod::Block::Named{:name("pod")}␤  Pod::Heading{:level("2")}␤    Pod::Block::Para␤      woot␤  Pod::Block::Para␤    look, a pod!␤]␤»
17:56 IOninja hm
18:02 pyrimidine joined #perl6
18:03 mr_ron joined #perl6
18:03 mcmillhj joined #perl6
18:05 IOninja m: "/tmp/Foo.pm6".IO.spurt: qq|package Foo \{ ␤=begin pod␤␤=head2 woot␤␤look, a pod!␤␤=end pod␤␤ our \$pod = \$=pod \};|
18:05 camelia rakudo-moar 80e0bc: ( no output )
18:05 IOninja m: use lib </tmp>; use Foo; say $Foo::pod
18:05 camelia rakudo-moar 80e0bc: OUTPUT: «[Pod::Block::Named{:name("pod")}␤  Pod::Heading{:level("2")}␤    Pod::Block::Para␤      woot␤  Pod::Block::Para␤    look, a pod!␤]␤»
18:05 IOninja :}
18:05 IOninja See if there's anything in https://raw.githubusercontent.com/perl6/specs/master/S26-documentation.pod
18:06 IOninja Or our docs builder it fishes the pods out of individual files, don't it?
18:06 timotimo no
18:07 timotimo it basically concatenates the equivalent of "return $=POD;" to the source code
18:07 IOninja ah
18:09 labster joined #perl6
18:11 IOninja m: say $=do-what-I-mean-dammit
18:11 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Pod variable $=do-what-I-mean-dammit not yet implemented. Sorry. ␤at <tmp>:1␤------> 3say $=do-what-I-mean-dammit7⏏5<EOL>␤»
18:12 IOninja So one day it will be? Cool. Will wait. :}
18:15 mcmillhj joined #perl6
18:17 [Coke] IOninja: https://github.com/perl6/doc/blob/coke/examples/lib/Pod/Convenience.pm6#L108
18:17 [Coke] that's the pod extraction routine.
18:17 [Coke] (in it's soon to be new home)
18:17 [Coke] gah, its
18:19 timotimo oh?
18:19 timotimo we don't have to do that terrible hack any more?
18:19 IOninja looks still pretty hackish :}
18:22 IOninja m: use lib </tmp>; use nqp; use Foo; say nqp::atkey($*REPO.loaded[0].handle.unit, '$=pod')
18:22 camelia rakudo-moar 80e0bc: OUTPUT: «[Pod::Block::Named{:name("pod")}␤  Pod::Heading{:level("2")}␤    Pod::Block::Para␤      woot␤  Pod::Block::Para␤    look, a pod!␤]␤»
18:22 IOninja kalkin-: ^ guess that's a way
18:22 IOninja "a" way
18:22 IOninja a "way"
18:23 khw joined #perl6
18:24 beatdown left #perl6
18:24 IOninja m: use lib </tmp>; use Foo; use nqp; say nqp::atkey($*REPO.loaded[0].unit, '$=pod')
18:24 camelia rakudo-moar 80e0bc: OUTPUT: «[Pod::Block::Named{:name("pod")}␤  Pod::Heading{:level("2")}␤    Pod::Block::Para␤      woot␤  Pod::Block::Para␤    look, a pod!␤]␤»
18:31 IOninja hah, raiph seems to have put the homepage weekly url as announcement in r/perl6 instead of the latest weekly. Reddit complains to me that I can't vote or comment :}
18:34 wamba1 joined #perl6
18:38 timotimo ?
18:40 IOninja nm
18:44 kalkin- IOninja & Coke thanks!
18:48 eliasr joined #perl6
18:56 labster joined #perl6
18:57 SourceBaby joined #perl6
18:59 IOninja Looks like there's a bug with `-n` + lines + words
18:59 IOninja s: (run(:out, <./perl6 -ne>, 'lines».words', './perl6').out.slurp-rest.say; exit)
18:59 SourceBaby IOninja, Something's wrong: ␤␤ERR: readline requires an object with REPR MVMOSHandle␤  in block <unit> at -e line 1␤␤
19:00 IOninja perl6 -ne 'lines».words'  # type a few lines then press CTRL+D
19:02 IOninja oh, words is not related. Just lines() and something to eager it
19:05 IOninja Seems already reported for get() https://rt.perl.org/Ticket/Display.html?id=128047
19:06 Tonik joined #perl6
19:07 alphah joined #perl6
19:08 RabidGravy joined #perl6
19:11 mcmillhj joined #perl6
19:11 Geth ¦ doc: 7eda47ebdc | (Will "Coke" Coleda)++ | doc/Language/haskell-to-p6.pod6
19:11 Geth ¦ doc: remove trailing whitespace
19:11 Geth ¦ doc: review: https://github.com/perl6/doc/commit/7eda47ebdc
19:11 Geth ¦ doc: 5092740945 | (Will "Coke" Coleda)++ | 2 files
19:11 Geth ¦ doc: new words
19:12 Geth ¦ doc: review: https://github.com/perl6/doc/commit/5092740945
19:15 pyrimidine joined #perl6
19:16 [Coke] issues installing p6doc via zef since we're using git ls-files to get files to test. (it installed OK, but I'm guessing the tests basically didn't run since it didn't find any files to test)
19:17 cognominal joined #perl6
19:17 [Coke] Not sure our sanity tests need to even be run by zef.
19:17 kalkin- How do i pipe some string to shell / run command?
19:18 IOninja I think I wrote a doc example for that somewhere...
19:18 * IOninja checks
19:18 gfldex https://docs.perl6.org/type/Proc
19:18 kalkin- gfldex: That's the first think i checked
19:19 IOninja kalkin-: first section, last code example: https://docs.perl6.org/type/Proc
19:19 [Coke] kalkin-: here's an example:
19:19 IOninja give run :in, and then $p.in.say: "Hello,\nworld!";
19:19 kalkin- IOninja: ohh thanks i missed this one
19:19 [Coke] https://github.com/perl6/doc/blob/master/xt/aspell.t#L52
19:19 IOninja I guess there's either a .print or .write method as well if you don't want the newline at the end
19:20 SmokeMachine m: say ㈤ + ㈠ # ???? sena_kun
19:20 camelia rakudo-moar 80e0bc: OUTPUT: «6␤»
19:20 IOninja sourcery!
19:20 kalkin- IOninja: afaik it's a IO::Handle which has all the nice functions
19:20 IOninja and IO::Pipe is IO::Handle
19:20 sena_kun u: ㈤
19:20 unicodable6 sena_kun, U+3224 PARENTHESIZED IDEOGRAPH FIVE [No] (㈤)
19:20 [Coke] just installed p6doc, tried "p6doc -f spurt" - got "Could not find Type::IO::Pathspurt Type::IO::Path at line 0 in:"
19:21 SmokeMachine sena_kun: I don't know why the PARENTHESIZED works but the not PARENTHESIZED doesn't...
19:21 IOninja aha, .print if you don't wnat the newline and .write takes a Blob to write
19:21 sena_kun m: say ㈠;
19:21 camelia rakudo-moar 80e0bc: OUTPUT: «1␤»
19:21 gfldex [Coke]: p6doc doesn't work, what is a know defect
19:21 IOninja u: IDEOGRAPH FIVE
19:21 unicodable6 IOninja, U+3224 PARENTHESIZED IDEOGRAPH FIVE [No] (㈤)
19:21 unicodable6 IOninja, U+3284 CIRCLED IDEOGRAPH FIVE [No] (㊄)
19:21 unicodable6 IOninja, https://gist.github.com/8d1d167f2ea8b1ed1d78202bed60d00d
19:22 sena_kun u: IDEOGRAPH TEN
19:22 unicodable6 sena_kun, U+3229 PARENTHESIZED IDEOGRAPH TEN [No] (㈩)
19:22 unicodable6 sena_kun, U+3245 CIRCLED IDEOGRAPH KINDERGARTEN [So] (㉅)
19:22 unicodable6 sena_kun, https://gist.github.com/c759d58afd9c82e1c9ceb9347651df9f
19:22 SmokeMachine u: 五
19:22 unicodable6 SmokeMachine, U+4E94 <CJK Ideograph> [Lo] (五)
19:22 IOninja Parenthesized works 'cause it's a `No`
19:22 sena_kun m: say ㈩㈠;
19:22 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Bogus postfix␤at <tmp>:1␤------> 3say ㈩7⏏5㈠;␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement modifier␤        s…»
19:22 IOninja And I guess the one that doesn't isn't
19:22 IOninja You can't use `No` chars as digits, only as separate numbers
19:23 IOninja m: say ༳
19:23 camelia rakudo-moar 80e0bc: OUTPUT: «-0.5␤»
19:23 IOninja :) my favourite char
19:23 cibs joined #perl6
19:23 sena_kun SmokeMachine, well, you still can't write 五千一.
19:23 SmokeMachine u: ༳
19:23 unicodable6 SmokeMachine, U+0F33 TIBETAN DIGIT HALF ZERO [No] (༳)
19:23 SmokeMachine sena_kun: yes, you can't...
19:24 SmokeMachine unless you use your slang! :)
19:24 IOninja m: sub term:<五千一> { 5001 }; say 五千一
19:24 camelia rakudo-moar 80e0bc: OUTPUT: «5001␤»
19:24 pyrimidine joined #perl6
19:25 IOninja m: say unival 五
19:25 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    五 used at line 1␤␤»
19:25 IOninja m: say unival "五"
19:25 camelia rakudo-moar 80e0bc: OUTPUT: «5␤»
19:25 IOninja m: say unival "千"
19:25 camelia rakudo-moar 80e0bc: OUTPUT: «1000␤»
19:25 IOninja m: say unival "一"
19:25 camelia rakudo-moar 80e0bc: OUTPUT: «1␤»
19:25 IOninja What number is it? 5001?
19:26 [Coke] gfldex: is there a perl6/doc issue #?
19:26 sena_kun SmokeMachine, sure. :) Though I still didn't understand how should I add it to a braid. I tried $*LANG.define_slang("MAIN", Kazu::Grammar, Kazu::Actions), but no success.
19:26 sena_kun IOninja, it is 5001.
19:26 [Coke] gfldex: also, any feedback on https://github.com/perl6/doc/pull/1207 ?
19:26 gfldex [Coke]: i think so
19:27 IOninja m: sub term:<五> {5}; sub infix:<千> {$^a*1000+$^b}; sub term:<一> {1}; say 五千一; say 一千五
19:27 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routines:␤    一千五 used at line 1␤    五千一 used at line 1␤␤»
19:27 IOninja dammit
19:28 IOninja m: sub term:<五> {5}; sub infix:<千> {$^a*1000+$^b}; sub term:<一> {1}; say 五 千 一; say 一 千 五
19:28 camelia rakudo-moar 80e0bc: OUTPUT: «5001␤1005␤»
19:28 IOninja \o/
19:28 gfldex [Coke]: i'm ok with the changed example test. If I got the time I may improve it a little to make it easier to use threads when that works relyable.
19:29 mcmillhj joined #perl6
19:29 IOninja sena_kun: maybe you need to do something like this? https://github.com/FROGGS/p6-Slang-Tuxic/pull/3/files
19:29 gfldex [Coke]: using the same precomp cache then the docs is a nice idea
19:29 sena_kun IOninja, wow, seems cool. Thanks, I'll try it!
19:30 IOninja $grammar isn't Kazu::Grammar but nqp::atkey(%*LANG, 'MAIN').^mixin(Kazu::Grammar)
19:30 IOninja sena_kun: and .define_slang stuff is available only on HEAD rakudo
19:31 IOninja was merged right after last release
19:31 cibs joined #perl6
19:32 dotness joined #perl6
19:32 sena_kun IOninja, well, my modules are always targeted on bleeding edge. :) Though you're right, it can be quite a bad practice, so I will not commit it right now. Also, what is the state of current versioning? I need to explisity mark things as "version 1.1" and commit with META6.json version increment wouldn't help me.
19:33 Geth ¦ doc/master: 8 commits pushed by (Will "Coke" Coleda)++, Altai-man++, (Will Coleda)++
19:33 Geth ¦ doc/master: e4c8c21cdc | refactor so extract-pod can be used elsewhere
19:33 Geth ¦ doc/master: 1610498482 | Run one example per test, not one file
19:33 Geth ¦ doc/master: 3499d0c47e | Count chunks from 1, not 0
19:33 Geth ¦ doc/master: 349ecc67b8 | Use EVAL instead of perl6 -c
19:33 Geth ¦ doc/master: 9e394d46df | change coding style
19:33 Geth ¦ doc/master: c36dd9a66c | Handle Pod Formatting codes
19:33 Geth ¦ doc/master: 313c01a6e7 | Add IO::String dependency
19:33 Geth ¦ doc/master: 1a999220f3 | Merge pull request #1207 from perl6/coke/examples
19:33 Geth ¦ doc/master: review: https://github.com/perl6/doc/compare/5092740945...1a999220f3
19:33 sena_kun [Coke]++
19:33 sena_kun *explicity
19:33 IOninja Whatsioning of what? modules?
19:33 sena_kun yep
19:33 IOninja Just bump the version in META file
19:34 IOninja META6.json
19:34 sena_kun IOninja, does zef understand that commits before were for old version and it will pull correct commit?
19:35 * IOninja doesn't follow the question.
19:35 tony-o_ sena_kun: it depends on how you're versioning your repo
19:35 tony-o_ soon, it will take the latest commit prior to the version being bumped.
19:36 IOninja oh, now I get it
19:36 mcmillhj joined #perl6
19:36 IOninja How does it know which commit got version bumped?
19:36 sena_kun tony-o_, for example, I've had 1.0. Then I do the commit with a version bump. And the next commit won't be pulled if user types something like zef install cool-1.0, right?
19:36 tony-o_ ideally, you'd bump the version every time you push but that may or may not be realistic.  another option would be 'release'ing your repo
19:36 sena_kun I double this question.
19:37 tony-o_ IOninja: that information is in the repo unless you erase the commit history
19:37 tony-o_ i have modules.zef.pm providing that info to zef cli right now, ugexe and i are both working on integration
19:37 IOninja cool
19:37 IOninja I don't get how that info is in the repo. You fetch each commit and check if the meta version changed?
19:38 tony-o_ sena_kun: right now i believe that it pulls the last commit for that version
19:38 tony-o_ so if you have 6 commits all with META v0.6 then you commit v0.7, it'll pull all 6 commits in v0.6
19:38 sena_kun tony-o_, awesome.
19:38 tony-o_ IOninja: a moment, i'll give you a one liner to figure that out
19:39 tony-o_ sena_kun: that is the way it was working, ugexe may have run into something and reverted that - i haven't been in that code for quite a while now
19:39 espadrine joined #perl6
19:39 jjido_ joined #perl6
19:39 astj joined #perl6
19:40 tony-o_ IOninja: git log -Gversion -p 'META.info' | egrep '^(commit|Date|\+\s+"version)'
19:41 tony-o_ change META.info to whatever your meta file is
19:42 tony-o_ output => https://gist.github.com/tony-o/dc0e6ecff75c0f77a151b474c8416d64
19:42 IOninja haha, clever :)
19:42 IOninja tony-o_++
19:42 sena_kun how can I specify some version to be installed? zef install Slang::Kazu-1.0 says that No candidates found. :/
19:43 andrzejk_ joined #perl6
19:44 mcmillhj joined #perl6
19:45 tony-o_ zef install 'Slang::Kazu:ver<1.0>'
19:45 sena_kun hmmm...
19:46 tony-o_ where is slang::kazu ?
19:46 tony-o_ lol Slang::SQL is over 2 years old now, time flies
19:46 mr_ron joined #perl6
19:46 tony-o_ FROGGS wins with the oldest Slang tho
19:47 sena_kun tony-o_, what did you mean by "where"? https://github.com/Altai-man/Slang-Kazu and in the ecosystem too.
19:47 rindolf joined #perl6
19:51 tony-o_ currently it doesn't look at git logs to determine version commits, that's in progress.  ugexe might chime in with better info about how it looks for previous versions, iirc it's a release or current version only.
19:51 tony-o_ or, the ecosystem file has specific versions listed in it along with the commit to use
19:52 sena_kun ah, okay then. even so it looks quite cool.
19:54 tony-o_ you can use v1.1
19:57 mcmillhj joined #perl6
19:57 jjido_ joined #perl6
20:06 mcmillhj joined #perl6
20:11 pyrimidine joined #perl6
20:18 tony-o actually, now i'm curious why you want 1.0 over 1.1 sena_kun ?
20:25 nicq201 joined #perl6
20:25 Geth ¦ doc: 8f1d849c82 | (Wenzel P. P. Peppmeyer)++ | 2 files
20:25 Geth ¦ doc: remove dep on IO::String
20:25 Geth ¦ doc: review: https://github.com/perl6/doc/commit/8f1d849c82
20:27 jjido joined #perl6
20:31 nicq201 left #perl6
20:32 sena_kun tony-o, dunno, just to test. But I don't think it is unbeilievable case when user wants some particular version that is not last.
20:33 sena_kun tony-o, it is my module if it's not clear, though I doubt it was the reason of your curiosity. :)
20:47 bjz joined #perl6
20:47 pyrimidine joined #perl6
20:49 [Coke] gfldex++
20:56 ugexe zef install https://github.com/Altai-man/Slang-Kazu/archive/8f02346a322486dca7db4077e57bb73b2b74cc97.tar.gz
20:58 pyrimidine joined #perl6
21:01 ugexe or if you ever installed it previously, it would be cached in ~./zef/store/Slang-Kazu.git and could just be installed with `zef install Slang::Kazu:ver<1.0>`
21:02 TimToady 'course, any slang that ain't Tuxic is probably gonna need to be updated to be braid compatible as Tuxic was
21:04 Geth ¦ doc: a713d52c01 | (Brad Gilbert)++ | doc/Type/IO.pod6
21:04 Geth ¦ doc: remove "if possible" from run
21:04 Geth ¦ doc:
21:04 Geth ¦ doc: The way it was worded could lead people to think that there was a circumstance where it would use the shell.
21:04 Geth ¦ doc: resolves #1208
21:04 Geth ¦ doc: review: https://github.com/perl6/doc/commit/a713d52c01
21:07 jjido joined #perl6
21:10 Tonik joined #perl6
21:22 cdg joined #perl6
21:25 cdg joined #perl6
21:26 TEttinger joined #perl6
21:30 jjido joined #perl6
21:39 astj joined #perl6
21:43 jjido joined #perl6
21:47 tony-o sql slang was written using tuxic as the model, if that doesn't work out then it'd be a good time to go back and update it so it can interpolate
21:50 alphah Noop Q: suppose I have a script that takes "add" or "del" as command line arguments, what is best practice to limit accepted args to the script? I'm thinking to create "enum" or a subset" type and pass it to MAIN sub. What would be the best practice for that?
21:50 RabidGravy joined #perl6
21:52 [Coke] could also: multi sub MAIN('add', ...) ; multi sub MAIN('del', ....)
21:53 [Coke] enum support was recently added, but I don't think it's wired into the usage statements yet
21:56 jjido joined #perl6
21:58 b2gills m: multi sub MAIN('add', *@args){}; multi sub MAIN('del',*@args){}
21:58 camelia rakudo-moar 80e0bc: OUTPUT: «Usage:␤  <tmp> add [<args> ...] ␤  <tmp> del [<args> ...] ␤»
21:59 alphah I'd like to avoid multi sub MAIN, instead I need MAIN to look like sub MAIN(Operation $operation), then can call $operation on object weather it is add or del
22:01 tony-o m: multi sub MAIN('add', Str :$named-arg) {...} # this also works for named args alphah
22:01 lukiramu joined #perl6
22:04 alphah I have about 7 operations, any one of them can be first arg to the script, if I use multi sub MIAN, then I will have to create 7 multi MAIN
22:06 alphah so the script can be called as "./script add <line> <file>" or "./script del <line> <file>" or "./script insert <line> <file>" or ...
22:06 b2gills If they are almost identical, you could have 7 MAIN subs that all just call a common sub. or you could handle everything yourself including a usage message
22:08 camelia joined #perl6
22:09 MasterDuke joined #perl6
22:10 b2gills m: enum Command <add del insert>; sub MAIN ( Command $command, $line, $file ) {...}
22:10 camelia rakudo-moar 80e0bc: OUTPUT: «Usage:␤  <tmp> <command> <line> <file> ␤»
22:11 b2gills m: @*ARGS = <add line file>; enum Command <add del insert>; sub MAIN ( Command $command, $line, $file ) { say $command }
22:11 camelia rakudo-moar 80e0bc: OUTPUT: «add␤»
22:13 b2gills an enum could be used with a USAGE sub
22:15 alphah Thanks b2gills, That did it. enum worked. Another question what is best practice , to use enum in this case or to define a subset type that has only 7 commands "add", "del",...
22:15 gdonald joined #perl6
22:16 b2gills An enum would probably be better, and possibly faster in the rest of the code you write
22:17 alphah Thanks!
22:19 b2gills by the way `sub MAIN ('add' ...)` is short for `sub MAIN ( Str $name where 'add' )` that is a subset
22:26 alphah Got that (y)
22:38 astj joined #perl6
22:38 mcsnolte joined #perl6
22:41 kyan joined #perl6
22:42 Voldenet joined #perl6
22:42 Voldenet joined #perl6
22:48 kurahaupo_ joined #perl6
22:57 devmikey joined #perl6
23:00 kurahaupo joined #perl6
23:21 cdg_ joined #perl6
23:26 pyrimidine joined #perl6
23:28 gdonald joined #perl6
23:30 * IOninja enjoys a freedom you can't have in US.
23:30 IOninja Kinder Surprise egg! :)
23:32 IOninja dammit... this toy sucks
23:33 tony-o we don't have those?
23:33 IOninja They're illegal.
23:33 IOninja Can't sell food with stuff inside of it.
23:34 tony-o like razor blades and things?
23:34 IOninja :)
23:34 tony-o hah, that's a pretty legit law - thanks gubment
23:41 lep-delete joined #perl6
23:42 cdg joined #perl6
23:50 ugexe thanks trump
23:55 telex joined #perl6
23:55 cpage_ joined #perl6
23:59 BenGoldberg joined #perl6

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

Perl 6 | Reference Documentation | Rakudo