Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-04-06

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:02 ZoffixWin m: subset ProductNumber of Str where { .chars <= 20 and /^ \d**3 <[-#]>/ };
00:02 ZoffixWin my ProductNumber $num = '333-FOOBAR';
00:02 camelia rakudo-moar c8ec5a: ( no output )
00:02 ZoffixWin ~_~
00:02 ZoffixWin m: subset ProductNumber of Str where { .chars <= 20 and /^ \d**3 <[-#]>/ }; my ProductNumber $num = '333-FOOBAR';
00:02 camelia rakudo-moar c8ec5a: OUTPUT«Type check failed in assignment to $num; expected ProductNumber but got Str ("333-FOOBAR")␤  in block <unit> at /tmp/9rFsDWAGrA line 1␤␤»
00:02 ZoffixWin m: subset ProductNumber of Str where { .chars <= 20 and $_ ~~ /^ \d**3 <[-#]>/ }; my ProductNumber $num = '333-FOOBAR';
00:02 camelia rakudo-moar c8ec5a: ( no output )
00:02 ZoffixWin Why is this so? Doesn't a bare // smartmatch against $_?
00:05 skids precedence
00:05 skids m: say (1 and 2 ~~ /2/)
00:05 camelia rakudo-moar c8ec5a: OUTPUT«「2」␤»
00:06 skids m: subset ProductNumber of Str where { .chars <= 20 and ($_ ~~ /^ \d**3 <[-#]>/) }; my ProductNumber $num = '333-FOOBAR';
00:06 camelia rakudo-moar c8ec5a: ( no output )
00:06 skids erm well.
00:07 skids The precedence should be fixed too.
00:07 ZoffixWin The example with $_ works as intended
00:07 skids oh.
00:07 ZoffixWin But if I omit the explicit $_, it fails. Presumably because it isn't smartmatching against $_
00:08 ZoffixWin m: $_ = 'foo'; say so /fo/;
00:08 camelia rakudo-moar c8ec5a: OUTPUT«True␤»
00:08 ZoffixWin Which it does here :S
00:08 * ZoffixWin is now more confused than ever.
00:10 skids m: say (.chars <= 20 and /^ \d**3 <[-#]>/)
00:10 camelia rakudo-moar c8ec5a: OUTPUT«Method 'chars' not found for invocant of class 'Any'␤  in block <unit> at /tmp/13X87rTKEb line 1␤␤»
00:10 skids m: $_ = "jj"; say (.chars <= 20 and /^ \d**3 <[-#]>/)
00:10 camelia rakudo-moar c8ec5a: OUTPUT«/^ \d**3 <[-#]>/␤»
00:10 skids aha.
00:11 skids the regex is not consdered bare.
00:11 ZoffixWin Ah
00:11 skids m: subset ProductNumber of Str where { .chars <= 20 and m/^ \d**3 <[-#]>/ }; my ProductNumber $num = '333-FOOBAR';
00:11 camelia rakudo-moar c8ec5a: ( no output )
00:12 ZoffixWin skids++
00:13 ZoffixWin skids, why does adding 'm' make it behave differently tho?
00:14 skids m// is an actual command to run the regex.  // is just a regex literal which only runs by virtue of being sunk.
00:14 cpage_ joined #perl6
00:15 ZoffixWin Ahh. Thanks.
00:15 skids (or appearing on the lhs of a smartmatch)
00:16 skids Really // only runs at all because perl 5 (and makbe awk?) users will expect that.
00:17 tardisx joined #perl6
00:18 johndau joined #perl6
00:20 sofi joined #perl6
00:23 tardisx joined #perl6
00:26 Atik joined #perl6
00:26 Atik left #perl6
00:32 ZoffixWin m: note 'bah'; say 42; subset Foo of Int where { .is-prime }; my Foo $x = 72;
00:32 camelia rakudo-moar c8ec5a: OUTPUT«bah␤42␤Type check failed in assignment to $x; expected Foo but got Int (72)␤  in block <unit> at /tmp/YJslEfF5_K line 1␤␤»
00:32 ZoffixWin m: note 'bah'; say 42; subset Foo of Int where { .is-prime or note "Not a prime" }; my Foo $x = 72;
00:32 camelia rakudo-moar c8ec5a: OUTPUT«bah␤42␤Not a prime␤»
00:32 ZoffixWin Why does using `note` stop further stuff (the 'Type check failed...' message) from being displayed?
00:33 ZoffixWin Ah, never mind.
00:33 ZoffixWin m: note 'bah'; say 42; subset Foo of Int where { .is-prime or do { note "Not a prime"; False } }; my Foo $x = 72;
00:33 camelia rakudo-moar c8ec5a: OUTPUT«bah␤42␤Not a prime␤Type check failed in assignment to $x; expected Foo but got Int (72)␤  in block <unit> at /tmp/Q930Vl5GxI line 1␤␤»
00:34 ZoffixWin m: my $w = warn 42; my $n = note 42; say [ $w, $n ]
00:34 camelia rakudo-moar c8ec5a: OUTPUT«42  in block <unit> at /tmp/cKzJBKuPM7 line 1␤42␤[0 True]␤»
00:49 BenGoldberg joined #perl6
00:51 perlawhirl joined #perl6
00:56 tardisx joined #perl6
00:57 MadcapJake still struggling with using require :P
01:00 sortiz MadcapJake, You are not alone, I'm struggling with units/packages too. :-)
01:01 MadcapJake m: my \wordmod = (require Test); wordmod::EXPORT::DEFAULT::.keys;
01:01 camelia rakudo-moar c8ec5a: OUTPUT«Could not find symbol '&DEFAULT'␤  in block <unit> at /tmp/GNPhdZ9iJJ line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/GNPhdZ9iJJ line 1␤␤»
01:02 atta joined #perl6
01:04 MadcapJake m: my \wordmod = (require Test); ::wordmod::EXPORT::DEFAULT::.keys;
01:04 camelia rakudo-moar c8ec5a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/AxKHA0PYME␤No such symbol 'wordmod::EXPORT::DEFAULT'␤at /tmp/AxKHA0PYME:1␤------> 3uire Test); ::wordmod::EXPORT::DEFAULT::7⏏5.keys;␤»
01:05 MadcapJake m: my \wordmod = (require Test); wordmod::.keys.say;
01:05 camelia rakudo-moar c8ec5a: OUTPUT«(&todo_output EXPORT &failure_output &output)␤»
01:05 MadcapJake m: my \wordmod = (require Test); wordmod::.kv.say;
01:05 camelia rakudo-moar c8ec5a: OUTPUT«(&todo_output sub todo_output () { #`(Sub|83228880) ... } EXPORT (EXPORT) &failure_output sub failure_output () { #`(Sub|83229032) ... } &output sub output () { #`(Sub|83229184) ... })␤»
01:05 MadcapJake hmm, guess I didn't need the all-caps stuff :P
01:06 MadcapJake hmm, in my own code I'm just getting (EXPORT)...
01:08 cdg joined #perl6
01:08 BenGoldberg m: __PACKAGE__.say
01:08 camelia rakudo-moar c8ec5a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/6WbAs_rKnV␤Undeclared name:␤    __PACKAGE__ used at line 1␤␤»
01:08 yoleaux 00:23 EDT <Xliff> BenGoldberg: I'd have to figure out how C++ mangles its functions. That's a task for another day.
01:11 MadcapJake I wish there was a Metamodel::PackageHOW doc page
01:13 sortiz m: my \m = (require Test); my \d = ::m::('EXPORT::DEFAULT'); say d::.keys; # This works MadcapJake
01:13 camelia rakudo-moar c8ec5a: OUTPUT«(&isnt &plan &pass &cmp-ok &flunk &does-ok &subtest &unlike &like &use-ok &todo &skip-rest &eval-dies-ok &is-deeply &throws-like &ok &is &diag &done-testing &is-approx &skip &dies-ok &lives-ok &eval-lives-ok &MONKEY-SEE-NO-EVAL &nok &is_approx &isa-ok &can…»
01:15 tardisx joined #perl6
01:18 eam joined #perl6
01:19 MadcapJake sortiz: I get «Combination of indirect name lookup and call not supported» when I try that
01:21 sortiz Yep, That is the reason I take the symbol fist in a var (d) , and then use d::.keys.
01:21 sortiz *first
01:23 MadcapJake Yeah I tried that though and got the same error o_O
01:26 ZoffixWin New blog post: Perl 6 Types: Made for Humans: http://blogs.perl.org/users/zoffix_znet/2016/04/perl-6-types-made-for-humans.html
01:26 MadcapJake I got an error that was cut off somehow: «Name ::($modname) is not compile-time known, and can not serve as a»
01:30 MadcapJake ZoffixWin: s/felt/fell/
01:30 MadcapJake (in second para)
01:31 ZoffixWin MadcapJake, felt as in feel, not as in fall :)
01:31 ZoffixWin I'm almost sure the original is right, though I'm quite drunk right now ^_^
01:31 MadcapJake You fall off your bike, you don't feel off your bike though
01:33 ZoffixWin MadcapJake, ah, there. Thanks! Fixed :)
01:33 * ZoffixWin feels off his bike, just 'cause
01:33 MadcapJake ZoffixWin: oh! I didn't notice there were two felt's in the para :P sorry!
01:34 MadcapJake ZoffixWin: I feel off my bike most days, I walk or drive most days ;)
01:34 * MadcapJake ruined his joke by saying 'most days' twice :P
01:36 dvinciguerra__ joined #perl6
01:37 * MadcapJake wishes blogs.perl.org had better Perl 6 highlighting :(
01:38 ZoffixWin I heard DrForr might have control over that :P
01:38 kid51 Does someone have the link to Ovid's 2016 Fosdem talk on Perl 6 (slides or text)?
01:39 ZoffixWin Yup
01:39 * ZoffixWin digs
01:39 MadcapJake I can only find the video
01:40 ZoffixWin kid51, video: https://www.youtube.com/watch?v=hR9UdvxMAbo
01:40 kid51 ZoffixWin: Thanks!
01:40 ZoffixWin kid51, you can probably get the slides too, if you ask ( https://twitter.com/ovidperl )
01:41 MadcapJake kid51: have you seen ZoffixWin's talk/slides? They're great too!
01:41 * geekosaur really wishes someone would consider text versions for those of us who have to work harder to deal with video :/
01:47 ZoffixWin http://tpm2016.zoffix.com <-- my talk with video linked to on the first slide
01:47 MadcapJake ZoffixWin: great blog post!
01:47 ZoffixWin Thanks.
01:47 ZoffixWin Actually, this is a better link for my talk because it includes answers to questions asked during it: http://blogs.perl.org/users/zoffix_znet/2016/03/wow-perl-6-talk-slides-recording-and-answers-to-questions.html
01:48 ilbot3 joined #perl6
01:48 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:49 Khisanth joined #perl6
01:52 MadcapJake I don't understand why this package stuff works in a repl but not in my sub :(
01:55 MadcapJake It says that my modules cannot be found when I just did the same operation from a  REPL, both using -Ilib so there should be no difference...
02:00 ugexe -I doesnt work with the REPL afaik
02:07 _z left #perl6
02:10 kid51 joined #perl6
02:12 MadcapJake ugexe: it does for me, I think it's a new thing.
02:13 MadcapJake I just got my module thingy working!
02:13 MadcapJake Now I got a strange error: «Odd number of elements found where hash initializer expected»
02:13 kid51 MadcapJake: I followed Zoffix's Toronto talk as he was giving it!
02:14 kid51 A miracle of technology!
02:14 ZoffixWin \o/
02:14 timotimo yawn :|
02:14 raiph MadcapJake: you know hash initializers expect a list with an even number of alternating keys and values, right?
02:14 MadcapJake the hash is actually an class object that does Associative, but I'm not sure where it's getting the elements number from...
02:15 Herby_ joined #perl6
02:15 MadcapJake kid51: nice! I didn't realize it was being livestreamed until it was too late :(
02:15 Herby_ Evening, everyone!
02:15 raiph hi Herby_
02:15 Herby_ \o
02:16 raiph and everyone else
02:16 kid51 toronto.pm has been fairly consistent about using Google Hangout, at least for slides
02:16 MadcapJake raiph: maybe I just need to avoid using the BUILD shortcut and bind the value to my % container
02:16 kid51 I gave a presentation remote for them the previous month
02:16 raiph MadcapJake: is this code you've already linked?
02:17 MadcapJake raiph: nope, wanted to try and get a working version before releasing it to the internet wolves :P but I may have to git push
02:22 johndau joined #perl6
02:22 MadcapJake m: my class Quux does Associative { method AT-KEY { $_.say } }; class Bar { has %.quux; submethod BUILD(:%!quux) {} }; my Bar $b .= new :quux(Quux.new); $b.quux<hello>
02:22 camelia rakudo-moar c8ec5a: OUTPUT«Odd number of elements found where hash initializer expected␤  in submethod BUILD at /tmp/WyKdM6b0PT line 1␤  in block <unit> at /tmp/WyKdM6b0PT line 1␤␤»
02:22 MadcapJake raiph: ^^
02:22 tardisx joined #perl6
02:26 MadcapJake I feel I may be missing a piece of the Associative puzzle..., I solved the last error by binding «%!hash-attr := %incoming-assoc-obj»
02:26 MadcapJake but now using self{$some-str} inside the object isn't working :(
02:28 MadcapJake now that error disappeared by giving the internal hash a type for it's values...strange!
02:30 raiph I wonder if implementing AT-KEY is not enough to make a class behave well enough for this scenario
02:31 raiph m: my class Quux does Associative {}; class Bar { has %.quux; submethod BUILD(:%!quux) {} }; say Quux.new<>
02:31 camelia rakudo-moar c8ec5a: OUTPUT«Quux.new␤»
02:31 raiph m: my class Quux does Associative {}; class Bar { has %.quux; submethod BUILD(:%!quux) {} }; say Quux.new<>.elems
02:31 camelia rakudo-moar c8ec5a: OUTPUT«1␤»
02:33 raiph m: my class Quux does Associative {}; say Quux.new<>.elems # MadcapJake (what would it take to make a Quux.new<> return an empty list?)
02:33 camelia rakudo-moar c8ec5a: OUTPUT«1␤»
02:38 noganex joined #perl6
02:41 shinobi-cl joined #perl6
02:43 MadcapJake raiph: I almost feel like there should be an ELEMS method
02:44 johndau joined #perl6
02:45 kid511 joined #perl6
02:46 raiph m: my class Hashtoo is Hash {}; say Hashtoo.new<>.elems
02:46 camelia rakudo-moar c8ec5a: OUTPUT«0␤»
02:46 raiph m: my class Hashtoo does Associative {}; say Hashtoo.new<>.elems
02:46 camelia rakudo-moar c8ec5a: OUTPUT«1␤»
02:46 raiph MadcapJake: I think that's the issue
02:47 sortiz raiph, No, MadcapJake is right, the class need a elems method.
02:47 raiph m: my class Foo is Map {}; say Foo.new<>.elems
02:47 camelia rakudo-moar c8ec5a: OUTPUT«0␤»
02:48 sortiz m: my class Hashtoo does Associative { method elems { 0 } }; say Hashtoo.new<>.elems
02:48 camelia rakudo-moar c8ec5a: OUTPUT«0␤»
02:49 MadcapJake oh you can just overwrite that :P that works!
02:49 MadcapJake raiph: why would Associative role provide one element though?
02:51 raiph because any single item is a one element list unless it does something to make that not be so
02:51 sortiz MadcapJake, Associative don't provide one element, is Any.
02:51 MadcapJake m: Any.new.elems.say
02:51 camelia rakudo-moar c8ec5a: OUTPUT«1␤»
02:51 MadcapJake huh
02:53 sortiz #perl6 o/
02:53 raiph goodnight sortiz
02:55 raiph m: class Foo does Associative {}; class Bar does Associative is Iterable; say Foo.new<>.elems, Bar.new.elems
02:55 camelia rakudo-moar c8ec5a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/JVCXugiqWD␤Method 'iterator' must be implemented by Iterable because it is required by a role␤at /tmp/JVCXugiqWD:1␤»
03:01 * MadcapJake is so close to a working version!
03:01 MadcapJake I can feel it!
03:07 BenGoldberg joined #perl6
03:20 geekosaur joined #perl6
03:23 ugexe ZEN-KEY?
03:30 ugexe m: class A { method ZEN-KEY { } }; A.new{}.elems.say
03:30 camelia rakudo-moar c8ec5a: OUTPUT«1␤»
03:37 vendethiel joined #perl6
03:39 MadcapJake ZEN-KEY?
03:41 ugexe i didnt read enough, so i dont think its anything you are interested in. but ZEN-KEY is {} and ZEN-POS is []
03:42 MadcapJake huh, didn't know that
03:42 ugexe m: class A { method ZEN-KEY { say "ZEN-KEY" } }.new{}
03:42 camelia rakudo-moar c8ec5a: OUTPUT«ZEN-KEY␤»
03:43 ugexe m: class A { method ZEN-POS { say "ZEN-POS" } }.new[]
03:43 camelia rakudo-moar c8ec5a: OUTPUT«ZEN-POS␤»
03:55 perlawhirl joined #perl6
03:56 perlawhirl hi perlers
03:57 timotimo heyo
03:57 perlawhirl is there a funky new way to dispatch to a sub from a variable (or string literal)... or is it just ye olde dispatche table?
03:57 timotimo you can .^find_method to get rid of one level of indirection
03:58 timotimo if you store the result of that, i mean
03:58 perlawhirl ahh, ok... all good... i got nothing against dispatch tables :D
03:59 timotimo we might generate a little in-line cache for you when you use a find-method-by-name op
04:00 timotimo don't rely on it performing terribly well
04:10 atta joined #perl6
04:13 papillion joined #perl6
04:17 perlawhirl joined #perl6
04:20 djbkd joined #perl6
04:27 BenGoldberg joined #perl6
04:29 jack_rabbit joined #perl6
04:39 Cabanossi joined #perl6
04:50 wamba joined #perl6
04:51 perlawhirl joined #perl6
04:52 MadcapJake early alpha of my Perl6-based Forth is about to hit github!
04:53 timotimo cool
04:54 MadcapJake so far I've only tested addition but it seems to work! :)
04:58 MadcapJake https://github.com/MadcapJake/rabble
05:03 timotimo no tests? :P
05:04 timotimo m: my @a = 1, 2, 3; @a.push: @a.pop<> xx 2; say @a
05:04 camelia rakudo-moar c8ec5a: OUTPUT«[1 (3 2)]␤»
05:04 timotimo aaw
05:04 timotimo m: my @a = 1, 2, 3; @a.append: ($ = @a.pop) xx 2; say @a
05:04 camelia rakudo-moar c8ec5a: OUTPUT«[1 2 2]␤»
05:04 timotimo that's even worse :D
05:34 MadcapJake Yeah xx is kinda wonky
05:35 MadcapJake "no tests?" geez! ;)
05:37 MadcapJake subtraction is backwards :P
05:40 timotimo it's not wonky. however, escaping thunking isn't trivial :)
05:44 Hakahme joined #perl6
05:46 MadcapJake I guess I wish this would work:
05:46 MadcapJake m: my @a = [1, 2, 3, 4]; say (@a.pop xx 4);
05:46 camelia rakudo-moar c8ec5a: OUTPUT«(4 3 2 1)␤»
05:46 MadcapJake huh! it works! lol
05:46 timotimo wish granted
05:47 MadcapJake lol, now I wonder why that didn't work for me earlier...
05:47 jdv79 m: say "(asd\)f)  )" ~~ /\([<!after \\>\)|.]*?\)/
05:47 camelia rakudo-moar c8ec5a: OUTPUT«「(asd)」␤»
05:48 domidumont joined #perl6
05:48 jdv79 how can i get that to capture asd\)f
05:51 timotimo your literal doesn't seem to contain the \
05:53 jdv79 oh
05:53 jdv79 still broke though
05:53 timotimo m: say "(asd\\)f)  )" ~~ /\([<!after \\>\)|.]*?\)/
05:53 camelia rakudo-moar c8ec5a: OUTPUT«「(asd\)」␤»
05:53 jdv79 m: say '(asd\)f)  )' ~~ /\([<!after \\>\)|.]*\)/ # too g
05:53 camelia rakudo-moar c8ec5a: OUTPUT«「(asd\)f)  )」␤»
05:53 timotimo right, the f doesn't go in
05:53 domidumont joined #perl6
05:53 jdv79 meh
05:53 jdv79 m: say '(asd\)f)  )' ~~ /\([<!after \\>\)|.]*?\)/
05:53 camelia rakudo-moar c8ec5a: OUTPUT«「(asd\)」␤»
05:53 jdv79 hmm
05:54 timotimo i'm not sure i understand what your code means to do, i.e. what makes (asd\)f a better match than '(and\)f)  )'
05:54 jdv79 a non greedy substring that contains its delimiter
05:55 jdv79 well. escaped.
05:55 timotimo ah, you want \) not to count, yeah?
05:55 jdv79 yeah
05:55 timotimo why is there a ! before the after, then?
05:56 jdv79 is that the wrong one?  i tried ? too.
05:56 jdv79 i read the docs - that's where i got it from
05:56 timotimo if you have a ?, that'd mean a ) is accepted by the inner thing that gets repeated when it's escaped
05:57 timotimo if you have a !, it wouldn't be accepted, then you'd fall out of the repetition and match it as the terminal ')'
05:57 jdv79 https://doc.perl6.org/language/regexes#Lookbehind_assertions
05:57 jdv79 i meant to use ? then
05:57 timotimo m: say '(asd\)f)  )' ~~ /\([<?after \\>\)|.]*?\)/
05:57 camelia rakudo-moar c8ec5a: OUTPUT«「(asd\)」␤»
05:58 timotimo m: say '(asd\)f)  )' ~~ /\(['\)'|.]*?\)/
05:58 camelia rakudo-moar c8ec5a: OUTPUT«「(asd\)f)」␤»
05:58 timotimo i would have done it like this, tbh
05:58 jdv79 yay
05:58 jdv79 thanks
05:59 timotimo :)
06:10 CIAvash joined #perl6
06:11 MadcapJake why do people have "*" for the version in META6 files?
06:12 nadim joined #perl6
06:16 _28_ria joined #perl6
06:22 timotimo in the early days we didn't have proper versioning for that at all, so there wasn't yet a "right value" to set
06:25 MadcapJake oh gotcha
06:26 MadcapJake ok well speaking of versioning, I fixed a few things and updated the META6, and that's it for v0.1.0! Time for bed then some more tomorrow.
06:26 MadcapJake g'night!
06:26 Possum joined #perl6
06:32 nadim Good morning, #1 is the code cache triggered by the date of the source or some sort of hashing?
06:34 psch code cache?
06:34 zakharyas joined #perl6
06:34 psch you mean module precomp storage?
06:34 nadim yes
06:36 timotimo wouldn't a "provides" section have to list every module you want to "use" even from within a module itself?
06:40 psch nadim: $prefix/share/perl6/dist/ has a (presumably) sha1 named file that holds timestamps for the modules in the distribution
06:40 psch nadim: i'd guess those are install (and thus precomp) time
06:41 sftp joined #perl6
06:42 psch nadim: further, CompUnit::PrecompilationRepository checks the timestamp of the path the PrecompilationStore points at
06:42 psch in method load, that is
06:43 psch nadim: so, my answer, after a cursory glance, is "timestamp" :)
06:43 nadim Thank you for the thorow investigation :)
06:47 nadim weird, git does not restore timestamp but I could swear that the precomp cache is shabby sometimes. last i checkout a branch ran and it worked while I was expecting it to fail, adding a single blank line got me to the expected behavior.
06:48 timotimo i thought we hash file contents
06:48 nadim have ther experirenced similat problems with the cache?
06:48 atta joined #perl6
06:48 nadim timotimo: and if it isn't, it should be. timestamps are a receip for failure
06:49 psch "thorow investigation" vOv
06:50 psch well, the sha1 calls that exist only pass variables named $name or $dist-dir.dir
06:51 psch in CompUnit{.pm,/*}
06:51 psch i don't wanna discount that it does actually hash, though, 'cause i'm really just glancing :)
06:52 nakiro joined #perl6
06:53 rindolf joined #perl6
06:57 psch m: class A { has $.a-long-attribute-name; submethod BUILD(:a(:$!a-long-attribute-name)) { } }; A.new(:1a).perl.say
06:57 camelia rakudo-moar c8ec5a: OUTPUT«A.new(a-long-attribute-name => 1)␤»
07:01 _nadim joined #perl6
07:04 psch hrm
07:04 psch is it too early for bitmasks or does this seem wrong?
07:04 psch m: my @a = [1,2,4,8]; my $b += $_ +< (4 * @a.index($_)) for @a; say $b.base(2).comb(/\d**4/)
07:04 camelia rakudo-moar c8ec5a: OUTPUT«(1000 0000 0100 0000 0010 0000 0001)␤»
07:05 ufobat morning perl6 :)
07:05 psch oh, it pads to 8 bits doesn't it
07:05 labster joined #perl6
07:05 psch i probably could have anticipated that
07:06 quester joined #perl6
07:09 psch okay, no, i'm just more confused now :(
07:13 psch m: my @a = [1,2]; say ($_ +< (4 * @a.index($_)) for @a)[1].base(2); say (@a[1] +< (4 * 1)).base(2)
07:13 camelia rakudo-moar c8ec5a: OUTPUT«1000000000␤100000␤»
07:13 psch something is weird there
07:15 psch m: $_ = 2; say ($_ +< (4 * 1)).base(2)
07:15 camelia rakudo-moar c8ec5a: OUTPUT«100000␤»
07:15 _nadim joined #perl6
07:16 Timbus umm
07:16 Timbus youre calling index on an array
07:16 Timbus thats a string method?
07:17 psch Timbus: oh! yes, that would do that
07:18 Timbus your generatory thing looks too clever, or not clever enough.
07:21 fireartist joined #perl6
07:22 psch m: my @a = [1,2,4,8]; my $b += .value +< (4 * .key) for @a.pairs; say $b.base(2).comb(/\d**4/)
07:22 camelia rakudo-moar c8ec5a: OUTPUT«(1000 0100 0010 0001)␤»
07:22 Timbus yeah, i was actually just writinf one using .kv
07:22 psch that's what i was looking for :) Timbus++
07:22 Timbus looks good now
07:28 masak morning, #perl6! :)
07:29 sjoshi joined #perl6
07:30 _nadim joined #perl6
07:31 psch m: my @a = [1,2,3,4]; my $b = 0b1111 +< (4 * (@a + 1)) + ([+] do .value +< (4 * (1 + .key)) for @a.pairs) + 0b1111; say $b.base(2) # and this is how i'm actually gonna use it
07:31 camelia rakudo-moar c8ec5a: OUTPUT«111101000011001000011111␤»
07:31 psch not opaque at all... :S
07:32 psch o/ masak
07:32 masak I'm so happy about the heroku thing
07:32 masak feels like I'm actually doing a real web application in Perl 6
07:32 masak pnu++ again, just on general principle :)
07:38 _nadim joined #perl6
07:40 winfred joined #perl6
07:40 winfred Hello
07:41 moritz hi winfred
07:41 winfred newbie here - first few days in perl6
07:42 winfred hello Moritz
07:42 winfred is this the right place for a ewbie or could you please point me somewhere
07:43 masak yes!
07:43 masak welcome!
07:43 winfred thanks
07:43 masak m: say "welcome, new person you!"
07:43 camelia rakudo-moar c8ec5a: OUTPUT«welcome, new person you!␤»
07:43 masak :D
07:43 ely-se joined #perl6
07:43 winfred :)
07:44 masak winfred: I think you'll find this channel quite helpful and friendly. I know I do.
07:45 winfred Masak: Sounds great . I am new to the Perl world and to the irc world for that matter
07:45 winfred please bear with me if I make some beginner mistakes
07:46 masak ok :)
07:47 winfred I am trying to start by writing some Grammar and trying to parse a file with it but it fails no matter what regex I throw at it
07:48 masak I would advise you to start small
07:48 winfred ok
07:48 masak and maybe proceed with tests from the get-go if you're able
07:48 masak let me write up a small example, hold on
07:48 moritz parsing typically lends itself very well to testing
07:49 winfred Tests? we have go to tests?
07:49 nadim joined #perl6
07:50 psch m: use Test; is 1, 1, "Mathematical identity can has go!"
07:50 camelia rakudo-moar c8ec5a: OUTPUT«ok 1 - Mathematical identity can has go!␤»
07:50 masak m: grammar Number { regex TOP { \d } }; use Test; ok Number.parse("4"), "one-digit number works"; nok Number.parse("FFF"), "some letters do not work"; done-testing
07:50 camelia rakudo-moar c8ec5a: OUTPUT«ok 1 - one-digit number works␤ok 2 - some letters do not work␤1..2␤»
07:50 masak winfred: you don't *have* to do it with tests...
07:50 masak winfred: ...but I find as a grammar grows (and it likely will), you're glad you have the tests because they ensure that you don't break the old stuff
07:51 masak winfred: anyway, see my example above. ask if anything's unclear
07:51 RabidGravy joined #perl6
07:52 winfred ok
07:52 * masak .oO( ask if anything's nuclear )
07:53 winfred let me try it out in my terminal and check it out
07:54 masak another advantage of writing tests for your grammars: whether you're a beginner or a pro with grammars, it's far too easy to write a rule that *looks* as if it does what you want, but doesn't. tests catch that, much sooner than you would yourself
07:55 masak 007 is basically a lot of tests for the grammar, and a lot of tests for the runtime. that's all :P
07:58 winfred let me read a bit about the test module and get back to you
07:59 masak http://docs.perl6.org/language/testing
07:59 winfred Thanks - will be back to bother you again :)
08:00 masak it's a deal!
08:07 bbkr joined #perl6
08:11 leont joined #perl6
08:12 psch huh, that's interesting
08:12 psch m: class A { has uint8 $.x; }; A.new(:x(5)).perl.say # all good
08:12 camelia rakudo-moar c8ec5a: OUTPUT«A.new(x => 5)␤»
08:12 psch m: class A { has uint8 $.x; submethod BUILD(:$!x) { } }; A.new(:x(5)).perl.say # but..?
08:12 camelia rakudo-moar c8ec5a: OUTPUT«Cannot modify an immutable uint8␤  in submethod BUILD at /tmp/40q_6n7sEm line 1␤  in block <unit> at /tmp/40q_6n7sEm line 1␤␤»
08:12 darutoko joined #perl6
08:13 psch am i being stupid again?  :)
08:14 g4 joined #perl6
08:15 moritz m: class A { has uint8 $.x; submethod BUILD(uint8 :$!x) { } }; A.new(:x(5)).perl.say
08:15 camelia rakudo-moar c8ec5a: OUTPUT«Bytecode validation error at offset 102, instruction 16:␤operand type 160 does not match register type 136␤  in block <unit> at /tmp/lIWi4xgzhZ line 1␤␤»
08:15 psch ...neat
08:16 moritz psch: I think the problem is that argument binding is *binding*, and you cannot bind to natively typed containers
08:16 moritz or something along those lines
08:16 moritz of course, that's LTA :/
08:17 psch especially with the roundabout binding hidden in the submethod invocation
08:17 psch that's gonna be a fun awesome error message to think up... :)
08:17 johndau joined #perl6
08:19 moritz well, I'd hope that we can modify the argument binding to deal with native attributes properly
08:19 moritz though I'm not nearly deep enough into the trench to know how feasible that is
08:20 psch i have a hunch it's from the generated accessor, so i'm building the commit right before to see if it worked then
08:20 psch mind, the hunch might well be wrong, my hunches (especially regarding the rakudo source) often are :)
08:21 moritz good that we can verify or disprove hunches :-)
08:23 masak moritz: so, who rakudobugs?
08:23 masak :)
08:24 psch exactly the same behavior as HEAD
08:24 psch i mean, thinking about my hunch argument binding shouldn't involve accessors anyway... :)
08:26 ocbtec joined #perl6
08:27 * masak submits rakudobug
08:37 winfred joined #perl6
08:39 zakharyas joined #perl6
08:40 btyler joined #perl6
08:44 brrt joined #perl6
08:46 moritz j: m: class A { has uint8 $.x; submethod BUILD(uint8 :$!x) { } };  A.new(:x(5))
08:46 camelia rakudo-jvm 5eaa15: OUTPUT«cannot connect to eval server: Connection refused␤»
08:47 espadrine joined #perl6
08:49 xinming joined #perl6
08:52 CIAvash joined #perl6
08:57 RabidGravy boom
09:02 abraxxa joined #perl6
09:08 abraxxa joined #perl6
09:12 mr-foobar joined #perl6
09:18 espadrine joined #perl6
09:18 abraxxa joined #perl6
09:21 babuba joined #perl6
09:21 babuba hey guys
09:22 babuba I sent an email to the mailing list, with code attached to it
09:22 babuba but in the archive of the list I see only the code, without explanations
09:22 babuba what did a do wrong?
09:22 babuba (here's the address if it helps - http://www.nntp.perl.org/group/perl.perl6.users/2016/04/msg2696.html)
09:23 babuba I used windows 10 mail client
09:23 moritz babuba: my mail client shows the message just fine
09:23 moritz babuba: so likely a problem with the software at www.nntp.perl.org
09:24 moritz oh, it's probably because it's a multipart message with one HTML part and one text part
09:25 masak nobody likes a MIME
09:25 moritz and it's quite usual to structure an email like this if you send it as HTML, and want to include a plaintext version
09:25 moritz so www.nntp.perl.org thinks the attachment is the plaintext version, and shows just that
09:25 babuba ok, thanks
09:26 babuba I've found the problem,but didn't want to spam if I was sending emails the wrong way :)
09:27 RabidGravy general rule of thumb is don't send multipart messages to mailling lists
09:27 babuba And what if I need to share code?
09:28 moritz babuba: use a plain text email, and include the code inline
09:28 babuba ok, thanks
09:28 RabidGravy yeah, and if it's too big to paste then it's probably too big for anyone to read anyway :)
09:49 atta joined #perl6
10:02 Upasaka joined #perl6
10:06 masak or link to the code in a gist/fiddle if it's very big
10:15 psch welp, let's hope that somewhere in the 334 pages of the MIDI spec it says how exactly realtime data and sysex messages work together... /o\
10:16 psch 'cause i only get lots of weird results the way i've been trying to get that to work... :)
10:17 RabidGravy I think it's "the responsibility of the receiver to do the right thing"
10:18 psch "The MIDI data stream is a unidirectional asynch
10:18 psch ronous bit stream at 31.25 Kbits/sec. with 10
10:18 psch bits  transmitted  per  byte  (a  start  bit,  8  data  bi
10:18 psch grrr
10:18 psch that was not the screen clipboard
10:18 psch The MIDI data stream is a unidirectional asynch ronous bit stream at 31.25 Kbits/sec. with 10 bits  transmitted  per  byte  (a  start  bit,  8  data  bi ts,  and  one  stop  bit).
10:18 psch *that* already surprised me
10:18 psch because i don't know if portmidi handles that internally already
10:19 RabidGravy that's the wire level spec
10:19 psch :/
10:19 psch i might be out of my depth :P
10:19 wilcov joined #perl6
10:22 psch RabidGravy: well, the problem with doing the right thing on the recieving end is that i'm not even getting everything i'm sending
10:22 psch or even something that only superficially resembles what i send
10:22 wilcov Hello :) I've got a question that might spark some mud throwing. That is not my intention. I'm a beginner looking to get into web security. I'm torn between perl and python 3 to learn as my first script language. Assuming the answer is Perl 6: Why is that better? Thanks in advance
10:23 RabidGravy psch, so in summary you are trying to send sysex *and* realtime messages at the same time?
10:24 psch RabidGravy: no, i'm successfully sending sysex, but recieving sysex doesn't work, because i haven't figured out how to bend Pm_Read around that it gets the whole message
10:24 psch RabidGravy: but sysex can be interleaved with realtime, so i probably should be able to figure out how to send both...
10:25 psch RabidGravy: basically, PortMIDI.read has to be quite a bit smarter, apparently :)
10:26 jast wilcov: web security is more about knowing the pitfalls and avoiding them, than about the choice of programming language
10:26 psch RabidGravy: the stumbling block in my path right now is that when i'm sending a sysex that would fit into a PortMIDI::Event i'm losing data-one, which is the MfID
10:26 psch as in, the resulting Event has data-one => Int
10:28 psch wilcov: if you're thinking about pentesting, Perl 6 seems a good choice because you can use a lot of Perl 5 and (at least some) Python via the corresponding inline modules
10:28 jast wilcov: and of course which language is better in general is entirely subjective. I guess people tend to like Perlish languages for their ability to express things extremely concisely. the other side of the coin is that there can be more of a learning curve, plus it's easier to make a mess of things, syntactically speaking. (you can make a semantic mess in _any_ language.) Python tends to prefer simpler and more uniform ways of expressing things.
10:29 RabidGravy 'ang on let me see what a "real" Sysex looks like when
10:31 wilcov Jast, psch: Thanks for the answers. Since perl has a reputation for begin good with data / text manipulation it might be 'better' (or atleast easier in the beginning) for the type of work i'll have to (indeed i.e. pentesting)
10:32 jast Perl 6 has some of the most advanced text processing things I know of, e.g. built in support for writing your own parsers
10:37 RabidGravy application level penetration is more about having good knowledge of the security failure modes of the platform and the implementation language and the imagination to find new ones rather than any particular set of tools
10:38 RabidGravy I mean you could just as well use curl to try and exploit a web application (and in fact it might be better because you get a higher turnaround)
10:39 dvinciguerra__ joined #perl6
10:39 wilcov Alright, thanks for the answers. It's something to think about
10:40 RabidGravy psch, I'm having difficulty simulating "real sysex" , are you on Linux?
10:41 psch RabidGravy: yeah, i'm on linux
10:41 psch RabidGravy: do you have anything standing around that could *send* sysex to dump that?
10:42 robertle joined #perl6
10:42 RabidGravy try sticking aseqdump on the "thru" port i.e. 14:0 and then sending your "sysex" to that and see what it says
10:43 psch alright
10:44 psch yeah, that works
10:44 psch which is good, because that means my patch for *sending* SysEx is good :)
10:45 robertle hi folks, I am confused about returning nothing from a sub in perl6: in perl5 you would do "return;", which would result in undef in scalar context and an empty array in list context. now in perl6 it seems as if "return;" and "return Nil;" are doing exactly the same thing, with the consequence that if I evaluate in list context a get a list with one entry...
10:45 psch < my $m = Audio::PortMIDI::SysExEvent.new(:MfID(MfID), :data([0b01010101])); > gives <  14:0   System exclusive           F0 7D 55 F7 > from aseqdump
10:45 kaare_ joined #perl6
10:46 robertle so how do I not return anything? why is this so different? there must be a good reason? puzzled...
10:46 psch robertle: you can't not return anything, but maybe an empty list works for what you're doing?
10:47 ZoffixWin robertle, it's so different because Perl 6 is a new language, not the next iteration of Perl 5, which still gets its own updates and new features.
10:47 ZoffixWin m: sub foo { return () }; my @a = foo; say @a
10:47 camelia rakudo-moar c8ec5a: OUTPUT«[]␤»
10:47 psch oh, we also have Empty
10:48 ZoffixWin m: sub foo { return Empty }; my @a = foo; say @a
10:48 camelia rakudo-moar c8ec5a: OUTPUT«[]␤»
10:48 ZoffixWin m: sub foo { return Empty }; my $a = foo; say $a
10:48 camelia rakudo-moar c8ec5a: OUTPUT«()␤»
10:48 robertle ZoffixWin: yeah, I understand that. but the fact that you could write a sub that does not return anything, no matter what the context, seems like a good thing. now you don't seem to be able to that anymore
10:48 ZoffixWin robertle, what's the usecase?
10:48 robertle let me play with the Empty a bit...
10:48 ZoffixWin robertle, it doesn't return "nothing" in Perl 5 either. You either get an undef or an empty list.
10:49 psch Empty disappears in lists, fwiw
10:49 psch m: say (1, 2, Empty, 3)
10:49 camelia rakudo-moar c8ec5a: OUTPUT«(1 2 3)␤»
10:49 ZoffixWin nice
10:49 psch which is probably what undef does in perl5..?
10:49 ZoffixWin nope :)
10:50 psch vOv
10:50 psch too long no perl5 for me :)
10:50 robertle not really sure about a usecase. but in perl5 we (at work) used to say that it's a good thing to do an explicit "return;" if you do not want to return anything. it makes it clear what you are after, and if you evaluate the method in some context you always get something undef/false. at some point there were dicsusions because java/c people used to write "return undef;", which of course evaluates to soemthi
10:50 robertle gn in list context
10:50 robertle I am trying to relate that discussion to the perl6 world
10:50 ZoffixWin Basically, you return "nothing" so you don't get a stray "undef" in your list, should you call your sub in list context.
10:51 ZoffixWin robertle, IMO that's nothing useful and just taking a questionable coding practice a bit too far.
10:51 RabidGravy the notion of "list context" isn't quite the same in Perl 6
10:52 psch so Empty does what "return;" does in perl5
10:52 psch well, returning Empty i guess
10:52 ZoffixWin m: sub foo { return Empty }; my $a = foo; my @a = $a, '42', 'meow', foo(), 'bar'; say @a
10:52 camelia rakudo-moar c8ec5a: OUTPUT«[42 meow bar]␤»
10:52 ZoffixWin robertle, Yes, Empty, as psch++ said seems to be the perfect thing for you to use in this case.
10:52 robertle ok, understood. and what you just said may be the root cause of the confusion: I am still thinking in terms of "list context", more playinjg required
10:52 * ZoffixWin isn't a fan of "explicit returns" TBH
10:53 Vlavv_ joined #perl6
10:53 teatime ?
10:53 psch ZoffixWin: last i checked they're like 3 times slower, too :/
10:53 teatime this entire conversation confuses the heck of out of me.
10:53 psch m: sub f { 1 }; f xx 50; say now - INIT now
10:53 camelia rakudo-moar c8ec5a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Jwftm2BYzT␤Undeclared routine:␤    xx used at line 1␤␤»
10:53 psch m: sub f { 1 }; f() xx 50; say now - INIT now
10:53 camelia rakudo-moar c8ec5a: OUTPUT«0.00180651␤»
10:53 psch m: sub f { return 1 }; f() xx 50; say now - INIT now
10:53 camelia rakudo-moar c8ec5a: OUTPUT«0.00188581␤»
10:53 ZoffixWin robertle, I found Perl 6 much hard to grasp until I decided to toss all of my notions of Perl 6. Perl 6 has proper types. Perl 5 doesn't. They're are very different languages. Perl 6 is closer to Ruby than to Perl 5.
10:54 robertle yeah, I know it's very different. perl5 gets in the way of learning perl6...
10:54 robertle but regarding the returns: why are you not a fan of explicit returns? a particular reason?
10:54 ZoffixWin robertle, have you tried Learn X in Y P6 page? I found it a nice short guide: https://learnxinyminutes.com/docs/perl6/
10:54 psch m: sub f { 1 }; f() xx 100000; say now - INIT now
10:54 camelia rakudo-moar c8ec5a: OUTPUT«0.0576417␤»
10:55 psch m: sub f { return 1 }; f() xx 100000; say now - INIT now
10:55 camelia rakudo-moar c8ec5a: OUTPUT«0.2099502␤»
10:55 psch they *are* slower still
10:56 robertle surely that slowdown is a VM/compiler weirdness and will get optimized away at some point...
10:56 jnthn Unless you're really squeezing out every last bit of performance you can for some reason, there's little reason to avoid them for that reason though. Especially when that'll likely get fixed in not too long :)
10:56 robertle I am more after the clarity than the speed really
10:57 robertle I find that even a small amount of if/else/for makes it hard to see where the exit point is. I am of course aware of the arguments for single exit points from functions, but this isn't the 70ies naymore... ;)
10:57 RabidGravy I actually think "return;" in a Perl 5 program is evil
10:57 kid51 joined #perl6
10:58 RabidGravy and "return undef;" even eviller
11:00 ZoffixWin robertle, thinking more about the code I wrote in the past, maybe I'm not against explicit returns altogether. I do use explicit returns for stuff I want returned, with the exception of `self` that I just leave on line by itself.
11:00 RabidGravy you do have to watch for  e.g.
11:00 RabidGravy m: sub nothing()  {  };  my @f = nothing(); say @f; sub empty() { Empty }; my @g = empty(); say @g
11:00 camelia rakudo-moar c8ec5a: OUTPUT«[(Any)]␤[]␤»
11:00 ZoffixWin I guess I'm not a fan of guidelines that want you to pretend very core and common features of the language might be unfamiliar to a new user :)
11:01 ZoffixWin Late for the bus! :(
11:01 jnthn bus-ted!
11:01 robertle ZoffixWin: ok, I agree there. I was more after the explicit return where i don't want to return a value, just return. so the arguably evil "return;" case. if this is evil, what to do instead? just leave the sub? that is quite hard to spot if it's not the last line
11:02 robertle RabidGravy: that is exactly my problem! in perl5 "return;" would evaluate to soemthing reasonable in both scalra and list context. in perl6 I don't see how to do that
11:04 RabidGravy well there isn't really a scalar or list context so it's kind of moot
11:04 ZoffixWin robertle, you do it with return Empty;
11:05 psch fwiw, the only scenario i can imagine where this matters is if people just put sub calls where ever they like without caring what those subs return
11:05 psch which i think is their problem, not a language design problem
11:05 ZoffixWin ditto
11:05 RabidGravy m: sub bar() { 1; }; for bar() { .say }
11:05 camelia rakudo-moar c8ec5a: OUTPUT«1␤»
11:06 robertle ok, agreed that it is a bit academic because it only matters if you look at the return value of soemthing that does not return anything, at which point you are to blame.
11:07 psch m: sub f { Empty }; f().WHAT.say
11:07 camelia rakudo-moar c8ec5a: OUTPUT«(Slip)␤»
11:07 robertle still interesting to follow up on some of these questions, I e.g. need to look a bit at the "there isn't really a scalar or list context"...
11:07 RabidGravy and if you really don't ever return anything then it's "returns Nil"
11:07 psch ...which only really can happen in an empty sub body
11:07 psch hm, or an if(/elsif) without an else where none of the cases match maybe?
11:08 psch m: sub f { if False { 1 } elsif False { 2 } }; f().WHAT.say
11:08 camelia rakudo-moar c8ec5a: OUTPUT«(Slip)␤»
11:08 psch m: sub f { if False { 1 } elsif False { 2 } }; f().say
11:08 camelia rakudo-moar c8ec5a: OUTPUT«()␤»
11:08 psch yeah, there too
11:08 psch oh, no, that's Empty, not Nil
11:09 RabidGravy or just stick Nil at the end of the sub
11:09 psch ah, but if you don't want to return the last statement you can trait_mod
11:09 psch m: sub f returns Nil { 1 }; say f()
11:09 camelia rakudo-moar c8ec5a: OUTPUT«Type check failed for return value; expected Nil but got Int (1)␤  in block <unit> at /tmp/YaM1Wg6b8y line 1␤␤»
11:09 robertle RabidGravy: and I was already content with the answers ;) sub t { return Nil; }; my @a = t; say @a; means that @a is quite something, it even has an element in it!
11:09 psch eh, no, not trait_mod, it's the one in the signature that does that...
11:09 psch m: sub f(--> Nil) { 1; }; f().say
11:09 camelia rakudo-moar c8ec5a: OUTPUT«WARNINGS for /tmp/YN24UaxQAx:␤Useless use of constant integer 1 in sink context (line 1)␤Nil␤»
11:10 psch m: sub f(--> Empty) { 1; }; f().say
11:10 camelia rakudo-moar c8ec5a: OUTPUT«WARNINGS for /tmp/1cwlQRK7_D:␤Useless use of constant integer 1 in sink context (line 1)␤()␤»
11:10 RabidGravy yeah Nil is a special kind of type object
11:11 psch .oO( and now a slang that makes all subs without explicit return return Empty... )
11:11 Timbus m: sub t { return () }; my @a = t; say @a;
11:11 camelia rakudo-moar c8ec5a: OUTPUT«[]␤»
11:13 psch m: sub f { Empty but [1,2] }; my @a = f; say @a
11:13 camelia rakudo-moar c8ec5a: OUTPUT«[]␤»
11:34 psch RabidGravy: i feel like Audio::PortMIDI::Event should probably be either a superclass to ::ChannelEvent and ::SystemEvent or a role
11:34 psch the role would be does'd by both those other two...
11:34 RabidGravy very probably
11:34 perlawhirl joined #perl6
11:35 psch and Stream.read is really gonna be complicated :/
11:35 psch with things like running status and status messages superseding unfinished previous messages
11:36 RabidGravy or flipping it the other way
11:36 psch right, for e.g. sample dump
11:37 RabidGravy so in fact the Event constructor applies the appropriate role when it has enough information
11:37 psch oh.  yeah, that makes more sense, actually
11:37 psch shows how often i think in roles i suppose :)
11:42 brrt joined #perl6
11:42 psch well midi specification, where *is* Table II? :S
11:44 perlawhirl are there any known issues with using subst with backreferences inside a map ?
11:44 perlawhirl i'm running into a issue where the subst is not working properly inside the map
11:45 perlawhirl referring to the {$0} it says 'Use of Nil in string context  in block'
11:45 wamba joined #perl6
11:48 psch perlawhirl: there's #126721
11:48 psch https://rt.perl.org/Ticket/Display.html?id=126721
11:51 psch well, that's only somewhat related i guess vOv
11:51 perlawhirl hmm, yeah not sure if related. show and tell time
11:51 perlawhirl show this is normal...
11:51 perlawhirl m: say 'Eleven11'.subst(/ « (..) \D+ /, {$0} );
11:51 camelia rakudo-moar c8ec5a: OUTPUT«El11␤»
11:52 psch i do remember that we had at least a few different problems with subst and $/
11:52 perlawhirl m: say 'Eleven11'.map({ $_.subst(/ « (..) \D+ /, {$0} ) });
11:52 camelia rakudo-moar c8ec5a: OUTPUT«Use of Nil in string context  in block  at /tmp/zoHXSqUb3W line 1␤(11)␤»
11:52 perlawhirl inside the map it can't see $0
11:52 perlawhirl eg...
11:52 perlawhirl m: say 'Eleven11'.map({ $_.subst(/ « (..) \D+ /, 'psch' ) });
11:52 camelia rakudo-moar c8ec5a: OUTPUT«(psch11)␤»
11:52 perlawhirl works fine
11:52 perlawhirl it's just the capture
11:53 psch m: say 'Eleven11'.map({ $_.subst(/ « (..) \D+ { CALLERS::<$/> = $/ } /, {$0} ) });
11:53 camelia rakudo-moar c8ec5a: OUTPUT«(El11)␤»
11:53 moritz workaround: declare $/ as a paramater for the block
11:53 psch ...what moritz++ said :)
11:53 moritz m: say 'Eleven11'.map({ $_.subst(/ « (..) \D+ /, -> $/ {$0} ) });
11:53 camelia rakudo-moar c8ec5a: OUTPUT«(El11)␤»
11:53 moritz or use S///
11:53 perlawhirl riiight... ok
11:54 moritz m: say 'Eleven11'.map({ S/ « (..) \D+ /$0/});
11:54 camelia rakudo-moar c8ec5a: OUTPUT«(El11)␤»
11:54 perlawhirl moritz++
11:54 perlawhirl i like using the more english-y operators, so always reach for subst
11:55 moritz interesting
11:55 perlawhirl erm... i mean methods
11:55 moritz I know .subst mostly as a relict from the times where the s/// and S/// syntax didn't work
11:55 moritz or didn't owrk properly
11:55 perlawhirl oh, really... that is interesting
11:55 perlawhirl i really like subst despite it's verbosity
11:56 moritz it's still useful, mostly when you get a regex object from somewhere else
11:58 perlawhirl can i do non-mutating substitutions with s/// or S///. i didn't even realise there were 2 versions :/
11:58 perlawhirl what does S do differently
11:59 psch m: $_ = "foo"; say s/o/u/; .say; $_ = "bar"; say S/a/u/; .say
11:59 camelia rakudo-moar c8ec5a: OUTPUT«「o」␤fuo␤bur␤bar␤»
11:59 perlawhirl cool
12:00 cschwenz joined #perl6
12:00 perlawhirl thanks. should i log a bug or is my original issue expected behaivior?
12:01 moritz perlawhirl: S/ is the non-mutating version
12:01 cschwenz Where is the documentation regarding how to create your own custom object stringification?
12:02 moritz cschwenz: I don't know, but it's just creating a method gist and/or Str, depending on the type of stringification you want
12:03 cschwenz ah, is .gist used for 'say $x;' while .Str is used for 'say "$x";'?
12:04 perlawhirl lyw
12:04 perlawhirl yes
12:04 perlawhirl erm... i didn't mean that... i wasn't answering you cschwenz... but yes, that is the difference :D
12:05 cschwenz sigh, thanks  (/me is annoyed i need to implement *2* methods to cover all cases of stringification)
12:08 moritz time to write a module that makes that easier!
12:09 cschwenz :-D
12:09 * moritz tries to come up with the most overpowered solutions for that
12:09 perlawhirl we are 2 modules away from 600 =D
12:10 moritz a parametric role that takes the actual stringification as a parameter?
12:10 moritz a custom meta class? That sounds like fun
12:12 winfred joined #perl6
12:17 psch ...how does any of this even work..?
12:17 psch apparently the timestamp flows over into the status byte /o\
12:26 MadcapJake Released an early version of my Forth (written in Perl 6!) last night: https://github.com/MadcapJake/rabble
12:26 wamba joined #perl6
12:28 hahainternet nice MadcapJake
12:29 hahainternet the breadth of perl6 increases daily :)
12:30 f3ew moritz: write a webapp which offers it as a service?
12:34 RabidGravy perlawhirl, I've got seven in flight, so it's in hand ;-)
12:34 moritz f3ew: tricky :-)
12:35 f3ew moritz: but it can be webscale!
12:35 RabidGravy right now I am however dicking around with javascript
12:40 molaf joined #perl6
12:46 perlawhirl RabidGravy: puttin' everyone to shame
12:46 sufrostico joined #perl6
12:47 RabidGravy or a software version of graphomania
12:48 RabidGravy which reminds me, I wanted to do something to Template6
12:54 perlawhirl night all
12:55 cdg joined #perl6
12:57 MadcapJake does provides in a META6 have to be *everything* (internal & external) or just the public interface?
12:58 RabidGravy if it is going to be "used" or "required" then it has to be in there
13:01 masak provides === export
13:03 winfred joined #perl6
13:03 masak RabidGravy: what if I have something like Games::Nex::Test, which only the .t files of my own module use? and I don't expect anyone else to ever need to use or require that...
13:04 masak I often end up with that kind of ::Test module, because I like to layer a set of domain-specific test functions on top of the generic ones. plus various other helpers.
13:05 RabidGravy yeah, I was of course omitting that part for clarity
13:05 masak I wasn't picking nits, I was generally curious
13:05 RabidGravy I always put any test modules under t/lib or whatever
13:05 masak the answer could just as well have been "that counts as a 'use' too, so you should provide it"
13:06 RabidGravy "use or require without any special provision to find the module" :)
13:08 masak but I have mine in lib/, so there's no special provision
13:08 masak I guess I'll keep it in provides for now
13:08 masak who am I to decide whether someone else has any use for it? :)
13:08 lizmat ZoffixWin++ # http://blogs.perl.org/users/zoffix_znet/2016/04/perl-6-types-made-for-humans.html
13:09 RabidGravy well if it's just used in your tests then "something else" makes the special provision to find the uninstalled modules
13:10 RabidGravy so "not in provides" == "not able to use or require as an installed module"
13:11 xchg joined #perl6
13:14 masak *nod*
13:14 perlpilot ZoffixWin++ indeed.   Some of the prose in that article makes me think ZoffixWin should write a Perl book.  He's got the right mix of information, interest, humor, and Perl.  Reminds me of the Camel book.
13:17 masak it's decided, then.
13:17 masak gee, I'm so glad we finally found someone! :P
13:19 moritz or maybe, uhm, ask ZoffixWin++ first? :-)
13:19 * masak .oO( yes, that was the joke )
13:24 perlpilot But jokes are supposed to be *funny*.  Like this one: http://www.smbc-comics.com/?id=3281
13:25 MadcapJake RabidGravy: so if users will only use Module and not Module::Submodule then all you need to have in provides is Module?
13:29 RabidGravy no, if, *after it is installed*, something needs to use it then it must be in the provides
13:31 novice666 joined #perl6
13:32 RabidGravy I don't think it matters whether that something is user code or your code
13:32 MadcapJake that seems bizarre though, provides should mean "public interface" not "every connected module file in this module"
13:33 novice666 Can I retrieve file's name assigned to  $*ARGFILES ?
13:34 skids joined #perl6
13:36 perlpilot novice666: good question.   I dunno if anything is specced or implemented in that regard though.
13:36 psch m: say IO::ArgFiles.^can('filename')
13:37 camelia rakudo-moar c8ec5a: OUTPUT«(filename)␤»
13:37 RabidGravy MadcapJake, possibly, but "find an installed module by name" is the same on both sides
13:39 MadcapJake Internally I think that CUR should just map everything inside lib directories and free up provides to be a map of the public interface.
13:40 perlpilot psch: now write the P6 equivalent of this P5:  while (<>) { print "$ARGV: $_" }  #  :-)
13:40 psch perlpilot: ...do i have to? :)
13:42 novice666 joined #perl6
13:42 masak perlpilot: now I'm really curious! how *do* you write the P6 equivalent of that? :)
13:42 masak surely there is a way! this is Sp^WPerl 6.
13:42 moritz for lines() { say $*ARGS.filename, ':', $_ }
13:42 moritz I'd assume
13:43 masak moritz: Dynamic variable $*ARGS not found
13:43 moritz masak: sorry, $*ARGFILES
13:44 masak ah, but $*ARGFILES w... right
13:44 masak yes, that works
13:44 moritz \o/
13:44 psch now for more than one file!
13:44 psch i think the perl5 snippet doesn't do that, does it
13:44 RabidGravy psch, yep that works for more than one file
13:45 moritz in both 5 and 6, I hope :-0
13:45 moritz seems to do
13:45 kerframil joined #perl6
13:47 shinobi-cl joined #perl6
13:47 shinobi-cl Hi all!
13:47 perlpilot shinobi-cl: greetings
13:47 shinobi-cl I am getting this error when trying to define a sized array inside a method... P6opaque: no such attribute '$!descriptor'
13:48 perlpilot shinobi-cl: show the code :)
13:48 brrt joined #perl6
13:49 shinobi-cl method get-sized-array {  my @sized[2;3] ;  }
13:49 shinobi-cl is only that
13:49 psch m: class C { method f { my @sized[2;3] } }; say C.f
13:49 camelia rakudo-moar c8ec5a: OUTPUT«[[(Any) (Any) (Any)] [(Any) (Any) (Any)]]␤»
13:49 psch nah, there's more involved, somewhere
13:49 shinobi-cl i might upload all the code but it might take a while,i have to detach the module from my app, and then upload
13:49 shinobi-cl yep
13:50 shinobi-cl y did the same test as you tring to get a use case but is something else....
13:50 shinobi-cl I*
13:51 moritz shinobi-cl: use the opposite approach: make a copy of your code, and throw out as much stuff as possible, while still keeping that error
13:51 moritz shinobi-cl: and when there's nothing more you can remove, you have a minimal example. That's the thing you should be showing us
13:51 shinobi-cl Thanks, i will do that!
13:51 moritz (and yes, that's more work than shouting "it doesn't work" :-)
13:52 shinobi-cl yeah, i know, i thought that may be was a known bug. I'll be back soon :)
13:52 ilmari what, no built-in faculty function/operator?
13:52 ilmari m: sub postfix:<!>{ [*](2..$^n) }; say 42!
13:52 camelia rakudo-moar c8ec5a: OUTPUT«1405006117752879898543142606244511569936384000000000␤»
13:53 boegel joined #perl6
13:54 moritz ilmari: nah, we have to leave one obvious example for a self-defiend operator :-)
13:55 moritz s/self/user/
13:55 cdg joined #perl6
13:55 [Coke] m: sub postfix:<!>{ [*](2..$^n) }; say π!
13:55 camelia rakudo-moar c8ec5a: OUTPUT«6␤»
13:56 cdg joined #perl6
13:56 * DrForr meditates on Γ($n)...
14:00 perlpilot DrForr: I expect at some point there will be a module in the ecosystem.   use Math::Functions; that'll have gamma, bessel, riemann zeta, etc.
14:00 moritz damn mathematicians, giving basically global objects like functions single-letter names
14:00 perlpilot (but probably with a better name :)
14:00 moritz who thought *that* was a good idea?
14:01 masak moritz: it is convenient, and they usually have long names, too.
14:01 [Coke] Math::Γ
14:01 DrForr At least it can use the Mathematical letters, especially for Bessel &c.
14:01 * moritz would still like to a scoping workshop with mathematicians
14:01 moritz *to do
14:02 RabidGravy well it all started when the scope was *some blackboard*
14:04 masak moritz: scoping in proofs would be a godsend
14:04 masak moritz: Lamport has a PDF about that which is a nice read
14:05 masak thesis being basically "mathematical expressions/formulae have been updated since the late middle ages -- proofs haven't. let's do that."
14:05 perlpilot When I was in college I took lots of math courses because I could do them, but I don't think I ever really understood what mathematics was all about until I walked in on my linear algebra prof and another prof sitting in a classroom scribbling stuff on a chalkboard.
14:05 perlpilot They were prodding the extent of some obscure equation.
14:06 masak perlpilot: for a while I thought that line would end "...until I walked in on my linear algebra prof and another prof in a steamy makeout session" :P
14:06 RabidGravy :-O
14:06 * masak .oO( that's when I really understood what mathematics was all about! )
14:06 perlpilot heh, I wrote that fictional line in my head too as I typed "walked in on my prof"
14:06 perlpilot :-)
14:06 geekosaur (are you sure it wasn't?)
14:07 * masak .oO( we have... unorthodox notions of "proof" in our department )
14:07 perlpilot "Fun with Math"  it's a new course offering
14:08 DrForr Math cannot be fun :( :)
14:08 perlpilot DrForr: where's your proof?  ;)
14:09 zakharyas joined #perl6
14:12 masak I definitely find math not just fun, but an essential part of what I enjoy thinking about
14:12 [Coke] I loved math in school; hard explaining it to my kids, who approach it with more like a dread.
14:13 [Coke] (/me keeps trying, though.)
14:13 masak I have spent large parts of the past year or so thinking about the regular dodecahedron
14:13 masak best thing, I can do it whenever and wherever. no equipment needed
14:14 Juerd Would you even do that in public? :P
14:14 DrForr I have several of them in my cabinet :)
14:15 perlpilot When I was a kid I found my dad's college trig book and it had some fun problems in it (not just trig, some were logic problems for instance)   I think that made a positive difference for me.
14:15 perlpilot (that's also why I've encouraged my kids to read the Martin Gardner books I have)
14:15 DrForr I should point out that I have a maths degree and studied high-dimensional minimal surface topology :)
14:16 DrForr And yes, Martin Gardner. I remember going into the back room in the school library and looking through the original Scientific American articles.
14:20 Sound joined #perl6
14:22 timotimo https://www.openstreetmap.org/way/310046324  <3
14:27 Sound Can I use the … operator for building a sequence where the item index affects the value? e.g. (1,2,4,7,11,16)
14:27 timotimo in that case i'd suggest using a simple "map" instead
14:27 masak Sound: sure!
14:28 timotimo right, with a state variable that works
14:28 moritz m: say (1..*).map(* ** 2 - 1)[%^5]
14:28 camelia rakudo-moar c8ec5a: OUTPUT«one((), 35)␤»
14:28 Sound timotimo: how do I create a lazy infinite list with that?
14:28 moritz m: say (1..*).map(* ** 2 - 1)[^5]
14:28 camelia rakudo-moar c8ec5a: OUTPUT«(0 3 8 15 24)␤»
14:28 moritz ah wayit, wrong sequence
14:28 timotimo like moritz just showed you ... but not quite :D
14:28 moritz m: say (1..*).map( 2 ** * - 1)[^5]
14:28 camelia rakudo-moar c8ec5a: OUTPUT«(1 3 7 15 31)␤»
14:29 timotimo hm, also not quite
14:29 Sound hehe, I got what you're saying, let me try
14:29 moritz ah no, it's n * (n-1), isn't it?
14:29 masak m: my $jump = 1; say (1, 2, * + $jump++ ... Inf)[^10]
14:29 camelia rakudo-moar c8ec5a: OUTPUT«(1 2 3 5 8 12 17 23 30 38)␤»
14:29 timotimo Central polygonal numbers (the Lazy Caterer's sequence): n(n+1)/2 + 1; or, maximal number of pieces formed when slicing a pancake with n cuts.
14:29 Ulti nine have you tried https://github.com/niner/Grammar-Highlighter with STD.pm6 ?
14:29 moritz m: say (1..*).map({ $^n * ($n + 1) / 2 + 1})[^10]
14:29 camelia rakudo-moar c8ec5a: OUTPUT«(2 4 7 11 16 22 29 37 46 56)␤»
14:30 Juerd m: say (1, 2, * + ++$ ... Inf)[^10]
14:30 camelia rakudo-moar c8ec5a: OUTPUT«(1 2 3 5 8 12 17 23 30 38)␤»
14:30 nine Ulti: err...no :)
14:30 RabidGravy Ooh, almost got nice interoperation between Crust/WebSocket and AngularJS!
14:30 Juerd State variables are nice to have in list generators :)
14:30 timotimo Sound: you have our best experts totally stumped here with your sequence :D
14:30 Sound timotimo: haha, I feel both sorry and proud of that!
14:30 Ulti nine do you think it would work? >:3
14:31 Sound timotimo: that sequence is made by adding the index to the previous value
14:31 nine Ulti: just try it :)
14:32 Ulti will do :)
14:32 timotimo oh, that sounds easy
14:32 Sound timotimo: so I'd imagine I could do it with something like 1, { $^a + $pos } … *
14:32 timotimo m: say (1, { $^prevval + $ } ... Inf)[^10]
14:32 camelia rakudo-moar c8ec5a: OUTPUT«Use of uninitialized value of type Any in numeric context  in block  at /tmp/Fa_m7T7z7O line 1␤Use of uninitialized value of type Any in numeric context  in block  at /tmp/Fa_m7T7z7O line 1␤Use of uninitialized value of type Any in numeric context  in …»
14:32 timotimo m: say (1, { $^prevval + $++ } ... Inf)[^10]
14:32 camelia rakudo-moar c8ec5a: OUTPUT«(1 1 2 4 7 11 16 22 29 37)␤»
14:33 timotimo also not quite
14:33 timotimo m: say (1, { $^prevval + ++$ } ... Inf)[^10]
14:33 camelia rakudo-moar c8ec5a: OUTPUT«(1 2 4 7 11 16 22 29 37 46)␤»
14:33 timotimo there we go
14:33 Sound m: say (1, { $^prevval + $++ } ^... Inf)[^10]
14:33 camelia rakudo-moar c8ec5a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ALX8ReZtma␤Preceding context expects a term, but found infix .  instead␤at /tmp/ALX8ReZtma:1␤------> 3say (1, { $^prevval + $++ } ^...7⏏5 Inf)[^10]␤»
14:33 * Sound cries
14:33 timotimo we don't seem to have ^...
14:34 Sound timotimo: aha.   anyway, very good!  so we have $^prevval, that's sexy
14:34 Juerd m: say (1, * + ++$ ... *)[^10]
14:34 camelia rakudo-moar c8ec5a: OUTPUT«(1 2 4 7 11 16 22 29 37 46)␤»
14:34 buharin joined #perl6
14:35 Juerd Is there a fundamental law of Perl 6 yet, that states that you can always make something less readable with *? :P
14:35 timotimo $^prevval is just "give the enclosing anonymous code block an argument called 'prevval'"
14:35 timotimo could have used $_ instead
14:35 Juerd Or * and no curlies :)
14:36 timotimo * . *
14:36 Sound timotimo: ah, interesting, that explains much.  So $^a and $^b are positionally named and the language does not define any 'a' and 'b'
14:36 timotimo that's right
14:36 timotimo also be careful that in the signature you get, the variables are sorted lexicographically
14:36 Sound being used to sort { $a <=> $b } I thought they were special vars
14:37 timotimo m: say { $^b ~ $^a }("world", "hello")
14:37 camelia rakudo-moar c8ec5a: OUTPUT«helloworld␤»
14:37 timotimo yeah, that's perl5, where they *are* special vars
14:37 Sound so ++$ is the trick in the above sequence.  Where is $ initialized/scoped?
14:37 timotimo which we think is a terrible thing :P
14:37 timotimo $ is an anonymous state variable
14:37 timotimo it's scoped to the innermost enclosing curlies
14:37 masak or thunk (with invisibul curlies)
14:38 ilmari is each $ a separate variable?
14:38 masak yes
14:38 Sound that's clear.  thank you for the private lesson :)
14:38 timotimo not quite private; any lurker in here can benefit from these lessons :)
14:38 masak $ reminds me more of the ff operators (which are also stateful) than of actual named variables
14:38 [Coke] m: say [+](1, 2, 2, 2 .. *)[^64]
14:38 camelia rakudo-moar c8ec5a: OUTPUT«(7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70)␤»
14:39 [Coke] m: say [+]((1, 2, 2, 2 .. *)[^64])
14:39 camelia rakudo-moar c8ec5a: OUTPUT«Use of Nil in numeric context  in block <unit> at /tmp/_zZ1c8IKae line 1␤Use of Nil in numeric context  in block <unit> at /tmp/_zZ1c8IKae line 1␤Use of Nil in numeric context  in block <unit> at /tmp/_zZ1c8IKae line 1␤Use of Nil in numeric context  …»
14:39 masak [Coke]: three dots instead of two?
14:40 timotimo that first result doesn't make sense to me
14:40 timotimo oh, when you add a number to a range, it moves the range
14:40 timotimo that's how that works, i see.
14:40 Juerd 16:37 < timotimo> it's scoped to the innermost enclosing curlies
14:41 Juerd timotimo: Isn't $ scoped to itself?
14:41 Juerd timotimo: A second $ in the same expression is another variable.
14:41 timotimo right, because it doesn't have a name
14:41 timotimo i just meant the state effect latches on to the innermost curlies
14:41 masak m: for ^10 { say $++ + $-- }
14:41 camelia rakudo-moar c8ec5a: OUTPUT«0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤»
14:41 masak timotimo: but... does it matter where it latches on, that's the question
14:42 ilmari m: for ^10 { say ($++, $--) }
14:42 camelia rakudo-moar c8ec5a: OUTPUT«(0 0)␤(1 -1)␤(2 -2)␤(3 -3)␤(4 -4)␤(5 -5)␤(6 -6)␤(7 -7)␤(8 -8)␤(9 -9)␤»
14:42 moritz yes, it does
14:42 masak timotimo: since you can't re-use a $, it sort of doesn't really have a scope
14:42 moritz m: for ^2 { for ^5 { say ($++, $--) } }
14:42 camelia rakudo-moar c8ec5a: OUTPUT«(0 0)␤(1 -1)␤(2 -2)␤(3 -3)␤(4 -4)␤(0 0)␤(1 -1)␤(2 -2)␤(3 -3)␤(4 -4)␤»
14:42 timotimo hmm
14:42 timotimo i guess that's fair :)
14:42 masak moritz++' example is also fair :)
14:42 moritz because if it latched to an outer scope, the inner for-loop wouldn't restart the sequence
14:42 * timotimo is AFK for a bit
14:42 masak that's screaming "innermost curlies" to me ;)
14:43 masak moritz: aye, good concrete example
14:43 masak *however*... :)
14:43 Juerd m: for ^3 { say hash { $++, $-- } }
14:43 camelia rakudo-moar c8ec5a: OUTPUT«Odd number of elements found where hash initializer expected␤  in block <unit> at /tmp/sB_o3vaDGe line 1␤␤»
14:43 timotimo Juerd: use ( ) instead of { } there
14:43 masak I doubt there's an observable difference between "it latches on to the innermost scope" and "it latches on to itself", since you can't re-use the same $ in the scope
14:44 Juerd timotimo: Oh.
14:44 masak Juerd: or just a listop without ()
14:44 Juerd timotimo: But then it's not a new set of innermost curlies so never mind :)
14:44 timotimo :)
14:44 timotimo you can use %{ ... } i think?
14:44 masak no, it's %()
14:44 timotimo OK
14:45 timotimo BBIAB
14:46 Juerd m: my %x; for ^3 { %x{$++} = $-- }; say %x.perl;
14:46 camelia rakudo-moar c8ec5a: OUTPUT«{"0" => 0, "1" => -1, "2" => -2}␤»
14:47 Juerd So, not really innermost curlies after all :)
14:47 [Coke] postfix hash curlies aint' blocks.
14:48 masak nor are circumfix hash curlies
14:49 Juerd So it should be 'innermost block', not 'innermost curlies'.
14:49 masak yeah
14:49 masak as it happens, if you try to use `$` inside of hash curlies, the hash turns into a block:
14:49 masak m: my %h := { foo => "a" }; say %h.perl
14:49 camelia rakudo-moar c8ec5a: OUTPUT«{:foo("a")}␤»
14:49 masak m: my %h := { foo => $++ }; say %h.perl
14:49 camelia rakudo-moar c8ec5a: OUTPUT«Type check failed in binding; expected Associative but got Block (-> ;; $_? is raw { #`...)␤  in block <unit> at /tmp/UlAnNHgG_y line 1␤␤»
14:50 masak (because of the heuristics used by Perl 6 to figure out whether you're writing a hash or a block)
14:56 atta joined #perl6
14:58 perlpilot That seems a tad obscure.  (I mean, I can see myself getting bit by that at some point)  I wonder if there's anything more we can do to help the programmer figure out what went wrong ...
14:59 b2gills masak: I think I have a design for a fairly quick sequence generator for prime factorization. ( basically it is very similar to what I have in that codegolf ) Forcing it to return a Bag would add some processing that may not always be necessary.
15:00 perlpilot (like detect use of anonymous state var and say something like "anonymous state variable turned hash curlies into a block, please use <mumble> instead"
15:00 perlpilot )
15:02 masak b2gills: ok, fair enough
15:04 b2gills What I find most interesting is that it is faster to just check 2 and all odd numbers than to use 「(2.. sqrt $^a).grep(*.is-prime)」
15:04 masak m: say bag(<a a b b b>).kxxv
15:04 camelia rakudo-moar c8ec5a: OUTPUT«(a a b b b)␤»
15:05 ilmari joined #perl6
15:05 masak b2gills: that doesn't surprise me so much
15:06 masak b2gills: should be about a factor of 2 difference
15:06 b2gills From a purely design standpoint a Bag would be better, but from a practical standpoint it may not be better
15:06 moritz well, using .is-prime repeatedly is a good way to kill performance
15:07 moritz if you're building a list of things to check, you can try to build a sieve instead based on simply divisibility checks, up to sqrt(n)
15:07 cschwenz joined #perl6
15:08 cschwenz out of curiosity, has anyone done a CAS in Perl6 yet?
15:09 perlpilot cschwenz: what does CAS mean in this context?
15:09 masak cschwenz: Compare And Swap?
15:09 cschwenz sorry, computer algebra system
15:09 moritz Computer Algebra System?
15:09 b2gills I found it faster to just keep reducing the input until the currently tested value no longer divides evenly.
15:10 perlpilot I was thinking cschwenz meant what moritz said, but then I thought of several other things it could mean.
15:10 atta joined #perl6
15:10 masak moritz: even a sieve is probably better replaced by probabilistic methods at some cutoff
15:10 moritz cschwenz: there's https://github.com/raydiak/Math-Symbolic
15:10 wamba joined #perl6
15:10 hoelzro o/ cschwenz
15:11 cschwenz cool!  so very glad i don't need to re-invent the wheel
15:11 cschwenz \o hoelsro
15:11 perlpilot cschwenz: you might need to make that wheel a little rounder though  :)
15:12 cschwenz that's okay, i still don't need to start with the square block  :-P
15:13 nadim joined #perl6
15:16 ilmari joined #perl6
15:16 cschwenz gah! sorry for the mistyped name hoelzro \o
15:16 hoelzro no worries =)
15:17 BrassLantern joined #perl6
15:18 DrForr Got a rasp?
15:19 kerframil joined #perl6
15:21 timotimo i wonder when we'll see raydiak active in here again :S
15:22 wamba joined #perl6
15:22 kerframil joined #perl6
15:22 ilmari joined #perl6
15:22 khw joined #perl6
15:26 ilmari joined #perl6
15:26 buharin joined #perl6
15:30 ilmari joined #perl6
15:31 dalek doc: 78137eb | titsuki++ | doc/Type/Pair.pod:
15:31 dalek doc: Add a missing single quote
15:31 dalek doc: review: https://github.com/perl6/doc/commit/78137eb2ab
15:31 dalek doc: 0b7d160 | (Zoffix Znet)++ | doc/Type/Pair.pod:
15:31 dalek doc: Merge pull request #445 from titsuki/add-single-quote
15:31 dalek doc:
15:31 dalek doc: Add a missing single quote
15:31 dalek doc: review: https://github.com/perl6/doc/commit/0b7d160c66
15:34 Sound joined #perl6
15:38 ilmari joined #perl6
15:39 Sound hm, wouldn't it be nicer if the succ method of a Rat incremented the numerator instead of adding 1?
15:40 masak sounds less hard to defend to me than just + 1
15:40 masak .succ usually means + 1
15:40 timotimo less hard to defend?
15:41 Sound masak: + 1 also loses the Rat semantics
15:41 timotimo the thing is, in perl6 you're very often using Rat without explicitly creating numerator/denominator
15:41 timotimo and sometimes you end up having the Rat be simplified by some operations
15:41 timotimo so you were going about your business increasing by 1/9th when you .succ'd, but suddenly you're getting a 1/3rd jump
15:41 timotimo WHAT'S UP WITH THAT!!!!kk
15:42 timotimo m: say pi.nude
15:42 camelia rakudo-moar c8ec5a: OUTPUT«Method 'nude' not found for invocant of class 'Num'␤  in block <unit> at /tmp/kpGQaOmonX line 1␤␤»
15:42 timotimo m: say pi.Rat.nude
15:42 camelia rakudo-moar c8ec5a: OUTPUT«(355 113)␤»
15:42 timotimo ^- would you expect pi.Rat.succ to be 1/113 more than pi?
15:43 gregf_ m: 355/113
15:43 camelia rakudo-moar c8ec5a: OUTPUT«WARNINGS for /tmp/vS3aOcm2C5:␤Useless use of "/" in expression "355/113" in sink context (line 1)␤»
15:43 timotimo m: say pi.Rat(0.000000001).nude
15:43 camelia rakudo-moar c8ec5a: OUTPUT«(103993 33102)␤»
15:43 Sound (pi/3 … 2*pi) actually adds 1 to each element, which is meaningless.  I'd expect it to behave like (pi/3, 2*pi/3 … 2*pi) instead
15:44 masak Sound: what timotimo said. perhaps it's better to think of a Rat not as a numerator and a denominator, but as a black-box rational point on the real line.
15:45 japhb m: .say for pi/3, 2 * pi/3 ... * >= 2*pi
15:45 camelia rakudo-moar c8ec5a: OUTPUT«1.0471975511966␤2.0943951023932␤3.14159265358979␤4.18879020478639␤5.23598775598299␤6.28318530717959␤7.33038285837618␤»
15:45 perlpilot Sound: how about we leave .succ alone and come up with a new special-purpose thing that does what you want?
15:45 Sound masak: I see
15:45 timotimo ratsucc? :P
15:45 japhb Sound: is that what you wanted?
15:45 * masak .oO( because we have too few things in the core setting... ) :/
15:45 timotimo "rats? ugh!"
15:45 japhb (Delta wanting a better approximate ending point)
15:45 Sound perlpilot: I'm too noob in Perl 6 to actually propose any addition to the design :P
15:46 masak I don't see a strong use case (yet) motivating adding something like this to core
15:46 perlpilot you didn't seem to have a problem proposing changing .succ's semantics :)
15:46 Sound perlpilot: heh, just sharing a ra(n)t ;-)
15:46 timotimo you can still use pi, * + 1 / pi.Rat.de ... *
15:47 japhb Sound: ... needs information about how you want to progress.  With successively more info, it adds one, adds a fixed increment, multiplies by a fixed multiplier, or follows a more complex rule of your specification
15:47 Sound perlpilot: I just find nonsense to think about 2.04 as a successor to 1.04, I'd expect .succ to be undefined so I'm curious about how that can be defended
15:48 perlpilot I can see the desire for an easy way "increment by some amount that isn't 1"  I just don't know where or how it might fit.
15:49 perlpilot (and I can't think of a "natural" incrementor that would apply to 1.04 and 355/113)
15:50 Sound perlpilot: incrementing the numerator in the latter one would sound reasonable to me
15:50 japhb m: .say for 1 ... 10; .say for 1, 3 ... 9; .say for 1, 2, 4 ... 16; .say for 0, 1, * + * ... 8;
15:50 camelia rakudo-moar c8ec5a: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤1␤3␤5␤7␤9␤1␤2␤4␤8␤16␤0␤1␤1␤2␤3␤5␤8␤»
15:50 japhb Sound: ^^
15:50 Sound I think this +1 behavior comes from .succ being used by the ++ operator, where +1 makes more sense
15:50 perlpilot Sound: what would you call it?
15:50 Sound perlpilot: .succ :-))))
15:50 perlpilot :-P
15:51 perlpilot What would you call it knowing that you can't call it .succ ?   :)
15:51 perlpilot and knowing that it only applys to numerics  (.succ doesn't have that restriction)
15:52 * Sound thinking hard
15:52 Sound well, any other naming sounds like a subptimal name, so ratsucc or anything else
15:53 Sound but just adding a method with another name is not very useful, IMHO .succ is useful because it's called by ++, … and other things
15:55 perlpilot Well ... one thing at a time.  Maybe if you can get a good method and a good rationale we can figure out a good operator :)
15:55 b2gills (1/8).rat-succ would become 1/4
15:55 timotimo "upnum"
15:56 Sound b2gills: does Rat automatically simplify the fraction?
15:56 b2gills In most cases yes
15:56 Sound there you go, I'm too noob in Perl 6 to actually propose anything
15:56 b2gills or rather Rational does
15:56 perlpilot But, though I was willing to entertain the thought experiment because I saw possibility, those possibilities seem to be rapidly collapsing as I prod this thing in my head.
15:56 timotimo m: say Rat.new(:numerator(2), :denominator(8)).perl
15:56 camelia rakudo-moar c8ec5a: OUTPUT«0.0␤»
15:56 timotimo m: say Rat.new(2, 8).perl
15:56 camelia rakudo-moar c8ec5a: OUTPUT«0.25␤»
15:56 timotimo m: say Rat.new(2, 8).nude.perl
15:56 camelia rakudo-moar c8ec5a: OUTPUT«(1, 4)␤»
15:57 Sound then my proposal of incrementing the numerator is nonsense too
15:57 perlpilot .num-succ ?  :)
15:58 Sound perlpilot: but if the fraction is simplified it's not useful as the series can't continue
15:59 b2gills Rational.new() does some simplifying, so you would have to do all of the MOP stuff at a lower level
15:59 Sound .num-succ.num-succ.num-succ should be equal to multiplying the numerator by 3, which it doesn't seem to be the case
16:00 Sound s/multiplying/incrementing/
16:00 perlpilot you'd have to make an object that knows how much it should be incremented by.   my $n = new.SpecialRat :inc(0.01);  # or something
16:00 ilmari joined #perl6
16:00 Sound brb # coffee
16:01 perlpilot (weird that I wrote new.SpecialRat rather than SpecialRat.new)
16:01 perlpilot I'm not sure I was thinking in Perl at that point
16:02 timotimo you can have "new SpecialRat: :inc(0.01)"
16:02 sortiz joined #perl6
16:02 Juerd timotimo: Sssh
16:02 Juerd timotimo: If nobody knows, nobody will use it, and it can be removed in 6.f or zo ;)
16:02 Juerd s/or zo/or so/
16:02 sortiz \o #perl6
16:03 timotimo you don't like indirect object notation?
16:03 Juerd Nope, not really.
16:04 Juerd I'm glad the : is required even with no arguments, so that at least "new Foo:;" is ugly enough that nobody will use it anyway :D
16:07 vendethiel joined #perl6
16:09 grondilu m: class A {}; dd new A:
16:09 camelia rakudo-moar c8ec5a: OUTPUT«A.new␤»
16:09 grondilu oh that's a thing indeed.  TIL.
16:12 telex joined #perl6
16:15 timotimo almost looks like something a stack language might have %)
16:22 tony-o is that do-able now?
16:22 timotimo is what do-able now?
16:22 tony-o new A;
16:23 timotimo new A:; is do-able
16:23 tony-o ah
16:23 tony-o i will use that syntax
16:23 tony-o Juerd: :-)
16:24 timotimo haha Juerd:;
16:24 Juerd Look what you did, timotimo!
16:24 timotimo no you
16:24 Juerd :)
16:25 Juerd http://rosettacode.org/wiki/Call_an_object_method#Perl_6
16:26 djbkd joined #perl6
16:41 zhi joined #perl6
16:41 leont joined #perl6
16:50 sue joined #perl6
17:00 hahainternet an odd question, i could probably google, can i embed rakudo into my C application? (Actually CGo but hey)
17:07 masak not that I'm aware
17:08 masak there'd have to be a rakudolib.so for that to be possible, I guess
17:09 ZoffixW joined #perl6
17:09 ilmari joined #perl6
17:10 ZoffixW Someone with perms should edit that Rosetta page to include:   my Thing $x .= new;
17:10 ZoffixW It locks $x into being of type Thing, so you reduce the chances of inadvertantly setting it to something else later in the code.
17:11 ZoffixW As for me writing a Perl 6 book: nope. I don't have enough motivation ,interest, or Perl 6 knowledge to write one :)
17:12 hahainternet masak: i was surprised that wasn't built by default
17:12 ilmari joined #perl6
17:12 * hahainternet shrugs, no rush
17:13 masak I don't know how much it would take to produce such a library. probably quite a lot. it simply hasn't been a priority at all until this point.
17:13 masak hahainternet: you are aware that you *can* embed C into your Perl 6 though, right? :)
17:14 hahainternet masak: indeed, and it shouldn't be too hard particularly, but i'm not trying to add any pressure
17:14 hahainternet masak: this is more to link perl6 into a multi language IRC bot, i also need to learn about camelia's security
17:14 hahainternet but i'm doing TCL & Perl 5 first probably
17:14 masak :)
17:17 ZoffixW m: use NativeCall; sub system (Str) is native {}; say system 'cowsay "what security?"'
17:17 camelia rakudo-moar c8ec5a: OUTPUT«sh: cowsay: command not found␤(Mu)␤»
17:17 ZoffixW ^_^
17:19 ilmari joined #perl6
17:20 hahainternet ZoffixW: indeed
17:20 zakharyas joined #perl6
17:21 Juerd I still don't get why NativeCall uses Str
17:21 Juerd C strings are so much unlike Str and so much like Buf...
17:22 leont They can be both, really :-/
17:22 leont Though I see your point of preferring Bug
17:22 leont Buf
17:22 b2gills The best way to do security from a programming standpoint is Capsicum, it allows you to programmatically disable OS features after you have used them, without any way to re-enable them https://www.freebsd.org/cgi/man.cgi?query=capsicum&amp;sektion=4
17:24 b2gills Google is in the process of bringing this to Linux for Chrome to use
17:24 b2gills at least that is what I've heard
17:26 kurahaupo joined #perl6
17:26 Ulti yay the glot.io guy merged my PR to add Rakudo support :3
17:27 Ulti one step closer to an executable funtime on perl6.org maybe?
17:27 arnsholt Juerd: Convenience, primarily
17:27 ZoffixW Ulti++
17:27 arnsholt But I've come to the belief that they're a bit over-used
17:30 hahainternet b2gills: the runtime may well sit in its own cgroup and namespace, but i can't (for example) disable opening files for the entire process if part of it has to, so there's a lot of complexity involved
17:31 RabidGravy gah, that's the second time today I've omitted the () on a javascript method and wondered why it wasn't working :-(
17:33 b2gills hahainternet: You can open files and then disable the ability to open files. If you later need to open files you will probably need to fork and pipe data around
17:33 tadzik good morning sir, do you have a moment to talk about typescript?
17:34 tadzik "Type () => string is not assignable to variable of type string" is wayyy better than chasing runtime bugs :)
17:34 * b2gills .oO( don't sir me )
17:34 hahainternet b2gills: yeah i originally needed to fork to deal with memory exhastion, but now i think i'll have to do it for proper security, it is a pain
17:36 b2gills I never got far enough in low-level languages to need fork() ( I think I can understand assembly better than C )
17:38 masak tadzik: yeah, typescript is clearly in the air. :)
17:39 jnthn Juerd: Str is supported 'cus if we made eveyrone write .encode('utf-8') or whatever on every single callsite they might go nuts. :)
17:40 cdg_ joined #perl6
17:41 spider-mario joined #perl6
17:48 grondilu b2gills: fork is actually a core command in Perl, isn't it?
17:49 [Coke] m: say &fork.WHAT;
17:49 camelia rakudo-moar c8ec5a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/XwdvZ8uu6e␤Undeclared routine:␤    fork used at line 1␤␤»
17:49 grondilu well, in Perl 5 that is
17:51 grondilu also fork creates a separate process, in the Unix sense.  Not sure why we don't have that in Perl 6
17:51 mst because it's not portable given perl6's targeting windows as well, but you can NativeCall wrap the syscall for unix specific code
17:52 mst (I was confused too and already harassed people to get that explanation ;)
17:52 leont joined #perl6
17:52 grondilu so Perl aims at being more portable than Perl 5?
17:52 grondilu *Perl 6
17:53 jnthn However, before you should do it, you should consider how fork interacts with threads, and that the VM will probably have threads you don't know about for doing stuff like GC, optimization, etc.
17:54 grondilu if you're doing both forks and threads, you're asking for troubles.
17:54 * jnthn figured so
17:55 leont It'd say it's more that combining forks, threads and a VM is trouble, pick at most two and stuff
17:55 jnthn Well yeah, it'll suck if your VM's GC thread doesn't survive the fork ;)
17:57 maybekoo2 joined #perl6
17:57 grondilu what about v5 btw?  Will it support forks?
17:59 grondilu m: use v5; print "ok" if fork;
17:59 camelia rakudo-moar c8ec5a: OUTPUT«===SORRY!===␤Could not find Perl5 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-1/share/perl6/site␤    /home/camelia/rakudo-m-inst-1/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-1/share/perl6␤    CompUnit::Repository::Absol…»
18:09 b2gills v5 is currently in major dis-repair
18:09 sjoshi joined #perl6
18:24 sortiz joined #perl6
18:30 Begi joined #perl6
18:48 addison joined #perl6
18:54 buharin joined #perl6
18:55 sufrostico joined #perl6
18:57 atta joined #perl6
19:06 tony-o hahainternet: what about using some other type of messaging system instead of directly embedding CGO into the application
19:08 perlpilot What's that style of method chaining typically seen in javascript code called?
19:08 * perlpilot is drawing a blank
19:08 tony-o thought it was just called method chaining or cascading
19:09 tony-o wikipedia thinks  named parameter idiom
19:11 perlpilot "fluent interface" is what I was looking for
19:12 tony-o what is fluent interface?
19:12 tony-o for 100
19:12 perlpilot https://en.wikipedia.org/wiki/Fluent_interface#JavaScript
19:13 perlpilot There's a Perl 6 example further down that page
19:13 tony-o i was playing jeopardy
19:13 tony-o and losing, like i do in normal jeopardy
19:13 perlpilot heh
19:14 skids Things that make me cynical for 200, Alex
19:15 labster joined #perl6
19:16 perlpilot This P5 code I'm editing at $work is written in a fluent interface style
19:16 timotimo yo RabidGravy, got any nice tips for stuff that'd teach me to play some melodies on my laptop?
19:16 timotimo RabidGravy: i just got sunvox and it has a nice "when you start it up, you have some nice default things to play with"
19:17 timotimo RabidGravy: kind of deal... like, start it up, press some keys, NOISE!
19:18 psch timotimo: that's an interesting tracker you found there
19:18 RabidGravy ooh that does look pretty
19:18 timotimo a friend recommended it to me. he also warned it's complicated and very powerful and quite different
19:18 psch yeah, it does look at least a bit different
19:18 timotimo also, it runs on everything
19:18 psch i mean, i've never dealt with modtrackers, but i dabbled with renoise a bit
19:19 timotimo also the "teenage engineering" mini-devices look so cutedorable: https://www.youtube.com/watch?v=MgHXqA1irwA
19:19 RabidGravy yeah I think the last time I used a tracker type thing was octamed on the Amiga twenty years ago
19:20 RabidGravy yeah those do look nice
19:20 timotimo have you seen them before?
19:21 psch that is pretty neat
19:21 RabidGravy yeah, I get email from teenage engineering every week or so :)
19:21 timotimo oh?
19:22 RabidGravy I keep meaning to get my hands on the chip they use in those
19:22 timotimo hah, only the chips? not get a device from them? :)
19:22 timotimo do you think i could benefit from having one of those?
19:23 timotimo there's a store in town that has them
19:25 RabidGravy I love little things that make noise :) The little drum machine thing is great
19:26 RabidGravy if you're interested in that kind of thing the you might consider the Korg Volca series, they differ in that the bass and drum things are actually analogue (apart from the sequencer)
19:26 RabidGravy obviously the sampler and FM synth not so analogue :)
19:27 psch hrm, sunvox doesn't do qwertz right :(
19:27 RabidGravy but I always suggest that people get small simple instruments if they feel intimidated by music making
19:27 timotimo psch: i have to change keyboard layouts anyway ... but i think you can configure keybinds properly
19:27 RabidGravy I have about ten african thumb harps here
19:29 timotimo ah, those
19:29 timotimo i've played with that kind of thing in the past
19:29 timotimo i've also had a short djembe course in the past. that was awesome
19:31 timotimo RabidGravy: do you know of something - perhaps in the browser - that'd teach me to play melodies on the same keys i'd be using for sunvox and friends?
19:32 RabidGravy somewhere in the house I have a "synth" which is basically two 555 timers intermodulating
19:32 timotimo hah :D
19:32 RabidGravy timotimo, you mean a computer keyboard?
19:32 timotimo yes, yxcvbnm,.-
19:33 timotimo i do have an electric piano nearby, but it doesn't do midi, so no program could help me see when i mess up
19:33 psch next up works too
19:33 RabidGravy I don't know of such a thing
19:33 timotimo god damn it :(
19:33 psch timotimo: what exactly is your goal?
19:33 timotimo psch: i want to learn how to music
19:33 psch timotimo: well, using only sdghj will probably sound good in any order
19:34 timotimo i want to be able to improvise a melody or two
19:34 psch same for 23567
19:34 RabidGravy though there is some vkeyboard app
19:34 timotimo huh, only the black keys?
19:34 psch yeah
19:34 psch those always work 'cause you leave out the complicated harmonies :)
19:34 timotimo is that so!
19:34 timotimo see, i've never been told something like that
19:34 timotimo my music education was ... lackluster
19:36 timotimo you know the kind of game where you have a piano at the bottom and the notes come flying down and you have to hit them?
19:36 RabidGravy mine was moderate, I was taught cello, bass and saxophone (though I'm not brilliant at any)
19:36 psch RabidGravy: upright?
19:37 timotimo hunchback
19:37 RabidGravy no bass guitar, I was taught by a jazz session musician who thought he owed my parents a favour
19:37 psch timotimo: https://en.wikipedia.org/wiki/Blues#Form the table on the right is what you could use as backing for your melodying
19:37 psch timotimo: note though if you take them as writting you'd have to improv with yxvbn (or qwrtz)
19:38 psch s/writting/written/
19:38 timotimo do the roman numerals correspond to the number keys on my keyboard for that? :P
19:38 psch timotimo: no, but it's all major chords (and you can ignore the 7)
19:39 timotimo i have not seen any instrument in my whole life where the notes were roman numerals
19:39 dha joined #perl6
19:40 psch timotimo: so that'd be C as y c b on the keyboard, F as y v n and G as x v m
19:40 psch timotimo: the roman numerals refer to the position of the root note of the chord in the scale.. :)
19:40 psch RabidGravy: that sound curious.  did you ask for lessons or did he just decide teaching you is making it up to your parents..?
19:41 psch 'cause i'd think having someone learn jazz bass at home might not really work for household peace... :P
19:41 psch especially fretless hah
19:41 timotimo at least it wouldn't sound like you're strangling a cat
19:42 timotimo psch: "root node" holds no meaning to me. and what does "in the scale" mean? and where is the start of that scale? and what even is this
19:43 psch timotimo: doesn't really matter, actually
19:43 psch timotimo: i mean, if you just want to improv
19:44 psch (note this assumes you have figured out how to write something into sunvox - i haven't yet :P )
19:44 timotimo i'm not writing stuff in sunvox, i just abuse its "press a key and you hear a noise" feature
19:45 timotimo i think you press the esc key to record
19:45 timotimo nope, very much not so d)
19:46 psch well, there's is a button "ins" in the top right :)
19:46 RabidGravy if you use  seq24 it can do "key constraints" in that has a piano roll type thing but when you select a "key" it greys out the notes that aren't in the key
19:46 timotimo oh
19:49 psch ...trackers really aren't for me :S
19:49 dalek doc: 5ddcf63 | (Tom Browder)++ | doc/Language/about.pod:
19:49 dalek doc: make it clear that the 'X' is not the documentable term
19:49 dalek doc: review: https://github.com/perl6/doc/commit/5ddcf63d24
19:49 dalek doc: 68a9aeb | moritz++ | doc/Language/about.pod:
19:49 dalek doc: Merge pull request #443 from tbrowder/master
19:49 dalek doc:
19:49 dalek doc: make it clear that the 'X' is not the documentable term
19:49 dalek doc: review: https://github.com/perl6/doc/commit/68a9aebb95
19:49 psch timotimo: my point was trying to tell you how you can program the blues form into sunvox by telling you which chord maps to which keys
19:49 psch timotimo: from there you can have it loop and play along
19:50 timotimo oh
19:50 psch like, what's called C in the table i linked is what you hear when you press y, c and b at the same time
19:50 psch err well
19:50 psch would be y if qwertz was supported :)
19:51 psch so i guess it's zcb on qwerty
19:51 psch F is zvn, G is xbn
19:52 psch err, G is xbm
19:52 psch C7 is zcbm
19:55 john51_ joined #perl6
19:56 yqt joined #perl6
19:57 RabidGravy y'see at the moment I have as much fun with an eight step sequencer with knobs
19:58 psch yeah, i'm starting to want hardware too, kinda
19:59 psch drawing stuff into a software sequencer is great for detail, but...
19:59 timotimo i wish i had keyboard layouts per window
20:01 Juerd Oh my. MS Windows has that and I find it incredibly annoying
20:02 Juerd It's not like you change keyboards when you switch focus. Or do you?
20:05 timotimo some programs really should be using scancodes instead of keycodes
20:07 Juerd Agreed.
20:07 * Juerd <- dvorak user
20:08 firstdayonthejob joined #perl6
20:08 Juerd Gimme ",aoe" instead of "wasd", please :D
20:08 timotimo i want liae
20:09 Juerd Which layout?
20:12 timotimo neo2
20:13 sufrostico joined #perl6
20:15 cdg joined #perl6
20:16 cdg joined #perl6
20:17 timotimo i'm doing terrible things to the ears in this room
20:20 timotimo maybe i'll never touch music ever again
20:20 timotimo nothing of value was lost :)
20:20 Woodi so fluent interfaces chain methods... but some years ago methods chaining was discouraged becouse what if method in the middle of chain return error - then rest of the chain is called on that, right ? but errors via exceptions resolve this ?
20:20 psch timotimo: eh, it's a skill
20:21 psch timotimo: look at it this way: you finding what you produce bad shows that you have at least taste, which often comes with talent
20:22 timotimo hahaha
20:22 psch yeah, it sounds funny but it is kinda true :P
20:24 psch i mean, if you wouldn't understand music at all it wouldn't sound shitty... vOv
20:24 Khisanth joined #perl6
20:28 timotimo i just don't know how to get anywhere from here
20:28 psch yeah, that's the hard part :)
20:29 psch now you have to make up something completely new that sounds good :P
20:29 psch something unheard, no accidental pachelbel!
20:29 timotimo well, in theory i could find some sheet music or some sheet like that
20:29 Begi1 joined #perl6
20:29 timotimo but i am extraordinarily slow at reading sheet music
20:30 timotimo i have to look up where the C is relative to the clef and then i just count the lines and spaces in between while saying the note names in my head
20:30 psch same :)
20:30 timotimo what's your involvement with music?
20:30 psch but tbh i don't think the computer keyboard is the kind of instrument where practice really pays off
20:31 timotimo i also have an electric guitar that's collecting dust
20:31 psch uh, i play guitar for like 12 years, bass guitar for like 8 or so, had half a year each lessons in alt saxophone and piano before the guitar, finished some 40 or so tracks with various DAWs...
20:31 psch i'm an semi-enthusiastical amateur i guess :)
20:31 timotimo doesn't sound half bad
20:31 ufobat joined #perl6
20:32 lostinfog joined #perl6
20:32 psch actually, a lot of it does sound about half bad :P
20:32 psch i mean, of the songs
20:32 timotimo oh my
20:32 timotimo in that case, how am i supposed to get to anywhere i'd be happy with myself?
20:33 psch practice more consistently than i do? :)
20:33 moritz through practise :-)
20:33 timotimo maybe in 10 years i can play something passable
20:33 timotimo if i do an hour every day
20:33 timotimo yeah ... right ...
20:33 psch hah
20:33 psch that's the thing though
20:33 psch what's "passable"?
20:33 psch playing Ode to Joy one-handed?
20:34 psch or playing Für Elise two-handed?
20:34 timotimo the latter, likely
20:34 timotimo i don't think ode to joy one-handed is terribly hard
20:34 colomon joined #perl6
20:34 moritz that doesn't take ten year, I'd think
20:35 ufobat tadzik, did you have a chance to look on my session code? I updated the PR because i found that a little thing was still missing. but it is basically still the same
20:35 psch timotimo: http://www.8notes.com/school/scores/piano/beethoven_fur_elise_orig1.gif look at the lower third
20:35 timotimo ah, yes
20:35 timotimo very notes
20:35 psch exactly
20:35 psch but
20:36 psch as moritz says, that's not ten years
20:36 timotimo always just one apart, eh?
20:36 psch it's about one or maybe two years of consistent practice
20:36 moritz 9.5 years should be enough :-)
20:36 timotimo %)
20:36 psch the upper half of that sheet takes maybe between 3 and 9 months or something
20:37 tadzik ufobat: will check it out, thanks for a reminder :)
20:37 timotimo yo tadzik
20:37 psch like, a few months after i quit piano lessons i tried to learn the first movement and it took me maybe a month, which is about 7 months in total, considering the practice before.. vOv
20:37 El_Che hehe
20:38 El_Che I am also starting piano
20:38 El_Che (to help daughter starting as well :) )
20:38 timotimo so, should i grab the electric keyboard and see what i can do?
20:39 timotimo or should i grab the guitar instead, because tabs are much easier to read than sheet music is?
20:39 El_Che this has been a great chear shortcut for me: http://www.amazon.com/Play-Popular-Piano-Easy-Lessons/dp/0671530674
20:39 psch hah
20:39 El_Che (I play (rock) guitar)
20:39 psch yeah, tabs are easier to read, but chords on a piano are so much easier :S
20:39 [Coke] timotimo: I learned how to read sheet music before I ever saw a guitar tab, so I'd disagree. :)
20:40 El_Che just play easy melody with the right hand and chords withs left. Sounds good
20:40 ufobat i find the notes not that hard because you dont have ans syncompation in it :p
20:40 El_Che imho I read sometime tabs, but most of the time you just look at the chords and play to the ear
20:40 ufobat but my piano skills suck, i think i can't estimate how hard this is.
20:41 psch the second movement in Für Elise is pretty tough
20:41 psch i mean, it's still not *hard* hard
20:41 psch but it is hard :P
20:41 ufobat like in "simple kind of hard"
20:42 psch yeah, it's mostly dexterity and muscle memory
20:42 tadzik timotimo: yo!
20:42 psch ...well, which instrument isn't vOv
20:42 brrt joined #perl6
20:42 ufobat i played violin for a few years, until my daugter started to walk ;) and wanted to grep the violin and play herself
20:43 RabidGravy when I was being taught saxophone I used to get told off for "remembering" the tunes rather than actually reading
20:43 tpa_ joined #perl6
20:44 psch that sounds like genuine pedagogical insight
20:45 El_Che in my opinion, it has to be fun, so not too steep. For that, guitar is great. You'll be singing the ramones in no time :)
20:45 ufobat well doesn't it depend? if you want to make musik remembering the tune and playing it.. is better because its the first step into improvisioning?
20:46 RabidGravy aren't all Ramones songs just C, G and D anyway? ;-)
20:46 ufobat lol!
20:47 mst they didn't really challenge the status quo, no
20:47 El_Che ufobat: my 8-year daughter reads a lot better becuase she learnt (basic) notes before playing piano. Because I have a "better ear" (playing an other instrument) I remember better, but reading is just too slow to just sit and play something without practising
20:47 sufrostico joined #perl6
20:47 ufobat 3 chords is already the "simple kind of hard"
20:47 ufobat aren't 2 sufficient!
20:47 El_Che well, you do the ramones and blues and you have years of fun
20:48 ufobat :D i just know blitzkrieg bob
20:48 El_Che A - D -E
20:48 El_Che limit to A and E and you can do mannish boy :)
20:48 RabidGravy ufobat, I think that was my problem, I'd been playing other instruments for years, so once I know where the notes are on an instrument and what key the piece is I can basically guess :)
20:49 El_Che RabidGravy: that++
20:49 ufobat El_Che, but yeah, when i started a new piece and played it for a couple of days you have an idea of the melody and tend to stop reading notes.. my teacher was strict about it too. Well i learnt reading sheet music as a child, i am/was good enough in it
20:50 ufobat yeah :D
20:50 El_Che what do now, learnig the piano is force myself to sing the notes while I play them
20:50 El_Che otherwise I, like you, just memorize or play by ear
20:51 Cabanossi joined #perl6
20:52 El_Che The book I linked has been great fun because you start with both hands right aways (although only playing chords with the left hand) so you get the impression you're "really" playing
20:52 ufobat RabidGravy, i actually find the violin more easy compared to guitar, when you want to play tunes on it.. for me a tuning based in 5th makes more sense. (compared to a tuning on 4ths and 3ths.. which is there like randomly )
20:53 psch ufobat: obvious solution: tenor banjo!
20:53 ufobat YEAH! :D
20:53 psch it has frets *and* a 5th tuning!!
20:53 ufobat or mandoline
20:53 RabidGravy I've got a couple of mandolins in the house, like the violin tuning
20:53 ufobat i own a mandoline for that "configuration" ;D
20:53 RabidGravy it's just really guitar upside down
20:53 TEttinger joined #perl6
20:53 psch hah, i know that
20:54 RabidGravy infact I have a banjolin too
20:54 psch 'cause i'm left handed
20:54 ufobat but i dont like playing it.. the tention in the strings is so hard
20:54 psch and normal guitars are upside down too :P
20:54 ufobat :D
20:54 colomon banjolin!
20:54 colomon My wife’s old roommate had one.
20:54 RabidGravy cool instrument
20:55 RabidGravy got it in a junk shop for twenty quid, plays perfectlt
20:55 colomon Mostly just treated as a toy, she is primarily a concertina player.
20:55 psch oh is that an extra octave for each string
20:55 RabidGravy yeah, eight strings
20:55 colomon don’t you tune the string pairs in unison?
20:56 psch i have no idea
20:56 psch i know about 12 string guitars, those have an octave for each string
20:56 dha I was just talking about banjolins on facebook recently...
20:56 colomon It’s certainly that way on the standard mandolins I’ve seen.
20:56 colomon (unison not octave)
20:56 * El_Che hopes a drummer shows up. Practically the only thing missing to start a perl6 band :)
20:57 dha colomon - you do on a mandolin, and I *think* it's usually that way on a banjolin as well, but I'm not positive.
20:57 RabidGravy I think there are almost as many stringed instruments in the house as synthesizers
20:57 psch ...i can play the rock base pattern and a really bad amen on drums :P
20:57 colomon isn’t there a perl 6 drum machine module, El_Che ?
20:57 El_Che colomon: A "Sisters of Mercy" fan? :)
20:57 dha RabidGravy - I'm definitely more string-equipped.
20:57 colomon El_Che: no
20:58 addison_ joined #perl6
20:58 dha I really need to actually *learn* how to play my mandolin at some point.
20:58 RabidGravy I wrote a module to manipulate/create Hydrogen song files
20:58 psch and a drum example for Audio::PortMIDI
20:58 RabidGravy and the Audio::PortMIidi has an example that plays a drum part
20:58 colomon RabidGravy: yeah, we have one synth and loads of string instruments.  and I cannot play any of the strings.
20:59 El_Che colomon: Doktor::Avalanche would be a great name for a perl6 module though
20:59 colomon on the other hand, we have even more wind instruments, and I can play almost all of those (except the weird ones purchased as jokes)
21:00 Khisanth joined #perl6
21:00 psch colomon: which are those?  the weird ones i mean
21:01 RabidGravy I've got one of those snake charmer pipes which I keep meaning to use in a track at some point
21:01 colomon psch: I dunno the names.  Family members will go overseas, find a weird Chinese flute or something, and buy it for me.
21:01 colomon On consideration, we have an insane number of musical instruments in the house.
21:02 RabidGravy which is a good thing
21:07 ufobat tadzik, oh my PR fails on travis, because URI::Escape is not in the META.json.. but that wasnt my fault.. i guess somewhere in Bailadors dependencies URI::Escape used to be in it, maybe?
21:11 hankache joined #perl6
21:12 hankache evening #perl6
21:13 addison joined #perl6
21:18 RabidGravy every once in a while the websocket::p6sgi craps out if the client browser is closed :(
21:18 firstdayonthejob joined #perl6
21:19 sufrostico joined #perl6
21:20 sue joined #perl6
21:21 hankache hiya RabidGravy
21:21 RabidGravy erp
21:24 RabidGravy "climacterical pale-eared scumfish Kincaid" best random test data of the day
21:27 addison joined #perl6
21:27 hankache bwahaha
21:31 RabidGravy and now I have put a "say" in the on-close of the websocket it doesn't fail
21:33 colomon joined #perl6
21:35 yurivish joined #perl6
21:35 cognominal joined #perl6
21:38 tharkun joined #perl6
21:39 RabidGravy hahahaha "pike-snouted smell-feast casemaking what-d'you-call-it precontrol fluxionist"
21:40 psch what a peculiar arrangement of words :P
21:40 psch i'm not sure it actually makes sense
21:40 timotimo i'm not sure it actually doesn't
21:47 addison joined #perl6
21:59 RabidGravy I'm just testing the logging thing and got bored of using the same old text all the time
22:00 RabidGravy just random words from /usr/share/dict/words
22:03 RabidGravy m: my @words = "/usr/share/dict/words".IO.lines;
22:03 camelia rakudo-moar 61d231: OUTPUT«Failed to open file /usr/share/dict/words: no such file or directory␤  in any  at /home/camelia/rakudo-m-inst-1/share/perl6/runtime/CORE.setting.moarvm line 1␤  in block <unit> at /tmp/ruUZUMeCa_ line 1␤␤Actually thrown at:␤  in block <unit> at /…»
22:03 RabidGravy m: my @words = "/usr/dict/words".IO.lines;
22:03 camelia rakudo-moar 61d231: OUTPUT«Failed to open file /usr/dict/words: no such file or directory␤  in any  at /home/camelia/rakudo-m-inst-1/share/perl6/runtime/CORE.setting.moarvm line 1␤  in block <unit> at /tmp/qvS0xGUrWS line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/qv…»
22:03 RabidGravy boo
22:04 timotimo uh. i instinctively logged in to hack, but that's not where camelia lives
22:06 RabidGravy :)
22:07 RabidGravy anyway gotta bed
22:07 RabidGravy toodles
22:07 psch o/ RabidGravy
22:08 masak RabidGravy: can't stand those precontrol flucionists
22:08 masak fluxionists*
22:09 von_cheam joined #perl6
22:14 Sgeo joined #perl6
22:16 skids joined #perl6
22:19 von_cheam left #perl6
22:26 TEttinger joined #perl6
22:29 sufrostico joined #perl6
22:38 ZoffixWin joined #perl6
22:38 ZoffixWin joined #perl6
22:39 ZoffixWin Do we still have the issue where panda aborts the install of multiple modules if a module is already installed? I'm thinking whether install will always fail if I specify URI and URI::Escape in `depends` when both are provided by the same distro...
22:47 ZoffixWin I guess there's one sure way to find out...
22:47 Praise joined #perl6
22:48 dalek ecosystem: 3ca4176 | (Zoffix Znet)++ | META.list:
22:48 dalek ecosystem: Add Twitter: https://github.com/zoffixznet/perl6-Twitter
22:48 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/3ca41763e2
22:49 ZoffixWin .tell stmuk our current modules.perl6.org doesn't support GitLab, so your Task::Galaxy isn't indexed....
22:49 yoleaux ZoffixWin: I'll pass your message to stmuk.
22:54 ZoffixWin (though still installable with panda it seems... requires Zef install though? :S)
23:01 masak 'night, #perl6
23:01 ZoffixWin night
23:27 cognominal maybe I missed it. But I don't see how to run rakudo to get heap snapshots.
23:32 diakopter cognominal: did you see https://github.com/jnthn/p6-app-moarvm-heapanalyzer
23:33 cognominal diakopter, yea, but how do I produce the file analised by the fine program>
23:34 cognominal how do I run rakudo to get a snapshot file ?
23:35 diakopter perl6-m --profile=heap
23:36 cognominal thx
23:40 maybekoo2 joined #perl6
23:53 cdg joined #perl6
23:57 johndau joined #perl6
23:58 sufrostico joined #perl6

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

Perl 6 | Reference Documentation | Rakudo