»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
teatime word. 00:00
MadcapJake teatime: I really do think that there should be an agreed upon standard for how to write docs inside code
timotimo that must be why perl5 users usually put the pod at the far end of the file
MadcapJake that'
Juerd teatime: I find pod in code absolutely terrible and find it hard to read code that uses it, because POD has its own, wildly different, block syntax. It has its own ideas on indentation and vertical whitespace.
MadcapJake that's one thing that's nice about doxygen and it's ilk, the documentation is uniformly laid out
teatime MadcapJake: Literate _______ is fun, where you have a doc that includes code blocks and the interpreter strips out the code blocks and concats them together to get the source code. 00:01
Juerd timotimo: This is indeed why I put my POD at the end of the code.
ZoffixWin teatime, as for relatedness. Well, docs not matching code is a "bug" in my mind.
teatime ZoffixWin: naturally. and one of the goals when you author is to minimize the chance of future bugs :)
timotimo so you minimize the amount of docs? :D 00:02
teatime lol
ZoffixWin doxygen.... there are many libs that have nothing but doxygen-generated docs--and I'm no C guru--they suck
teatime not that I'm saying always put the docs in the code, but as Juerd for documenting APIs and such I feel like it's the best place.
MadcapJake ZoffixWin: they're the only way I can ever navigate a C codebase
ZoffixWin Interesting.
teatime ZoffixWin: that's a combination of doxygen sucks and/or people suck by being too lazy to make decent docs / additional non-code docs / doxygen configuration
but I agree, auto-gen'd docs usually sucks for various reasons 00:03
timotimo some of these reasons being obvious
Juerd One issue I have with a docstring-like approach is that not everything that I'd want to document, is a block that can contain a string literal. For example, with "has $.foo is rw;" I want to document .foo 00:04
teatime MadcapJake: I actually think having a (subset of) doc layout that mirrors the code is generally a fail
Juerd At one point I suggested "is explained("...")" or "is documented("...")" as a tongue-in-cheek suggestion. I haven't been able to come up with something better.
MadcapJake teatime: like where the pod is laid out in a similar fashion to the codebase?
teatime might work well for a few codebases, but most would benefit from some human intervention in where to make section/chapter breaks 00:05
MadcapJake: no, as in, the "docs" show you a file/class hierarchy from the code
ZoffixWin The best docs I've seen to date are that of P5's Mojolicious (metacpan.org/pod/Mojolicious). They're concise enough to get the gist and if you can look at the source to get the details.
There *is* such a thing as too many docs.
Juerd Many things that I like to see in documentation, can now be put in signatures.
MadcapJake github.com/jashkenas/journo/blob/m....litcoffee
timotimo that's literally coffee 00:06
MadcapJake literARy you mean :P
Juerd Can you *name* your return value, with -->? 00:07
i.e. if you indicate --> Bool, can you hint that this boolean indicates success? 00:08
MadcapJake no, you can make it a constant though
Juerd That's another thing that would make documentation more consistent if automated.
teatime in past projects I have used a specialish block comment syntax (e.g. /** */ to indicate embedded markdown, and then had a file that manually included every file that contained docs (although sometimes with globbing) so that I could have control over sections etc. and ordering. and also I would be aware of where in the hierarchy I was when writing the markdown, so that I could do whatever was appropriate (have
a section header, or not, etc.)
it worked pretty well, but it worried me because it felt like it would be fragile. 00:09
timotimo putting a variable name after the --> is planned, but NYI
teatime heh, you could: name the return value, and then assign to it in the block to override implicit return value!
Juerd Hm, a variable name. How would that work? Would it declare the variable, and would you do "--> Bool $success;" and then "$success = True;" instead of "return True;"? 00:10
ZoffixWin m: subset Meows of Any where /foo/; sub foo ( --> Meows ) { "bart" }; foo
camelia rakudo-moar 4f3f1c: OUTPUT«Type check failed for return value; expected Meows but got Str ("bart")␤ in sub foo at /tmp/uzkir6Aef9 line 1␤ in block <unit> at /tmp/uzkir6Aef9 line 1␤␤»
timotimo %) 00:11
brilliant
teatime timotimo: which?
timotimo the subset one
Juerd: i expect it to work like that
MadcapJake m: subset IsSmall of Bool; sub foo($i --> IsSmall) { $i < 100 }; foo(10).say 00:12
camelia rakudo-moar 4f3f1c: OUTPUT«True␤»
timotimo in that example i don't see a reason to not call the sub is-small instead
MadcapJake timotimo: sure, trivial example I suppose 00:15
timotimo hm. i wonder how efficient subset types are where we don't have a refinement
MadcapJake m: subset SmallStr of Str where *.chars < 10; sub foo($s --> SmallStr) { $s x $s.chars }; foo('two').say; foo('four').say; 00:17
camelia rakudo-moar 4f3f1c: OUTPUT«twotwotwo␤Type check failed for return value; expected SmallStr but got Str ("fourfourfourfour")␤ in sub foo at /tmp/WprFseLKgP line 1␤ in block <unit> at /tmp/WprFseLKgP line 1␤␤»
00:44 El_Che joined 00:48 raoulvdberge left 00:50 Sgeo_ joined 00:52 cdg left, Sgeo left, cdg joined 00:58 cdg left 01:00 lizmat joined 01:04 Sqirrel left 01:05 lizmat left 01:11 wamba joined
MadcapJake ZoffixWin++ # subtest pair form 01:14
01:15 shmibs_ is now known as shmibs
teatime MadcapJake: got a link? 01:15
timotimo it's on the users mailing list, i think 01:16
rt.perl.org/Public/Bug/Display.html?id=127890
i was wrong
teatime thx 01:17
MadcapJake Also: github.com/rakudo/rakudo/pull/743 01:18
01:22 dogbert17 left 01:25 molaf left 01:26 awwaiid joined, Actualeyes joined 01:31 wamba left, vendethiel- joined
MadcapJake how much of S26 is implemented? 01:35
syn: 26
syn: #26
i don't remember how to do that
timotimo S26 01:36
S26:01
synopsebot6 Link: design.perl6.org/S26.html#line_01
MadcapJake ahh
S26:
S26:00
synopsebot6 Link: design.perl6.org/S26.html#line_00
01:37 molaf joined, jolts joined, jolts left 01:38 Sqirrel joined 01:39 BenGoldberg joined 01:41 jolts joined, jolts left 01:45 jolts joined, jolts left 01:48 jolts joined, jolts left
hoelzro MadcapJake: declarative docs don't handle B<> and friends correctly 01:51
and I think there's a handful of other NYI stuff 01:52
01:52 jolts joined, jolts left
MadcapJake I know that $=NAME doesn't work, the only access point is $=pod 01:53
01:54 gfldex joined
hoelzro oh yeah =/ 01:55
01:55 kid51 left
hoelzro I remember I was going to take a crack at doing B<> sequences in declarative POD, along with $=NAME 01:55
01:56 jolts joined, jolts left
hoelzro but then I decided that the entire POD system should probably be ripped out into a language living on the braid, and then I got discouraged =( 01:56
MadcapJake hoelzro: why do you think it should be ripped out? 01:58
hoelzro MadcapJake: the way it works is LTA, and would be better suited living in its own grammar
01:59 jolts joined, jolts left 02:01 Sqirrel left 02:03 jolts joined, jolts left, captain-adequate left 02:04 aindilis joined 02:06 jolts joined, jolts left 02:09 jolts joined, jolts left 02:13 jolts joined, jolts left 02:16 jolts joined 02:17 jolts left 02:19 Khisanth joined 02:20 jolts joined, jolts left 02:21 cdg joined 02:24 jolts joined, jolts left 02:27 jolts joined, jolts left 02:31 jolts joined, jolts left 02:35 jolts joined, jolts left 02:36 _28_ria left 02:37 _28_ria joined, sue_ joined 02:39 jolts joined, jolts left 02:41 noganex_ joined 02:43 jolts joined, jolts left
dalek Iish: ee76c70 | (Salvador Ortiz)++ | lib/ (3 files):
SQLite: Use NativeLibs pre-load services.

This avoid the NC::guest_library_name dance at every 'is native', so Native!setup work is reduced. As this depends on platform-specific semantics on MoarVM's dyncall, any success/failure report on OS X or Windows is appreciated.
02:46
02:47 jolts joined
sortiz Ups s/guest/guess/ 02:47
02:47 jolts left 02:51 jolts joined, jolts left 02:55 jolts joined, jolts left 02:56 BenGoldberg left 02:58 BenGoldberg joined, jolts joined, jolts left 03:02 jolts joined, jolts left 03:04 vike joined 03:06 jolts joined, jolts left 03:08 Celelibi_ joined 03:09 jolts joined, jolts left 03:13 jolts joined, jolts left 03:16 jolts joined, jolts left 03:20 jolts joined, jolts left
tony-o MadcapJake: I wouldn't mind having a health rating here, merging koaltee and this 03:20
03:24 jolts joined, jolts left 03:27 jolts joined, jolts left 03:31 jolts joined, jolts left 03:33 BenGoldberg left 03:34 sue_ left, yqt left 03:35 jolts joined, jolts left 03:39 jolts joined, jolts left 03:42 jolts joined, jolts left 03:43 zdm joined 03:46 jolts joined 03:47 jolts left 03:50 jolts joined, jolts left 03:54 jolts joined, jolts left 03:56 Celelibi_ is now known as Celelibi, cdg left 03:58 jolts joined, jolts left 04:02 jolts joined, jolts left, _nadim left 04:06 jolts joined, jolts left 04:10 jolts joined, jolts left 04:12 Sqirrel joined, cpage_ left 04:14 jolts joined, jolts left 04:18 jolts joined, jolts left, skids left 04:19 Cabanossi joined 04:22 jolts joined, jolts left 04:23 sue_ joined 04:29 dsp-_ joined, nebuchad` joined, aindilis` joined 04:30 cognominal_ joined, jolts joined, M-matthew left, apejens left 04:31 xiaomiao left, apejens joined, nebuchadnezzar left, jolts left, Actualeyes left, awwaiid left, arnsholt left, krakan_ left, mprelude left, cognominal left, a3r0 left, Ulti left, nine left, arnsholt joined, nine joined, Ulti joined, krakan joined, jolts joined, jolts left, mprelude joined 04:32 aindilis left, khagan left, Actualeyes joined, khagan joined, infina joined, Possum joined, xiaomiao joined, awwaiid joined, a3r0 joined, jolts joined 04:34 cyberviking joined 04:35 k-man joined, baest joined, M-matthew joined 04:44 molaf left 04:49 cgfbee joined 04:58 telex joined 05:03 [Sno] left 05:04 sno joined 05:07 sno left 05:08 sno joined 05:13 sue_ left 05:34 cyberviking_ joined 05:35 cyberviking left 05:48 mohae left 05:54 sortiz left 05:56 CIAvash joined, Khisanth left, Khisanth joined 05:59 nienacko__ joined, notostraca joined, maddingu1 joined 06:01 gtodd1 joined, zostay_ joined 06:02 mephinet joined, kent\n joined, kent\n left, kent\n joined 06:03 autarch1 joined, ilmari_ joined, avuserow1 joined 06:04 telex left, telex joined, m0ltar_ joined 06:05 krunen_ joined, frederico joined, riatre_ joined, Woodi_ joined, noganex joined, [Coke]_ joined 06:06 jjido joined, nightfro` joined, eyck_ joined 06:07 diakopte1 joined, lnr joined 06:08 cyberviking_ left, khagan left, nine left, noganex_ left, pierrot left, dg left, Gothmog_ left, diakopter left, TEttinger left, skarn left, m0ltar left, autarch left, orbus_ left, chansen_ left, eyck left, kentnl left, tim__ left, ugexe left, mephinet- left, ilmari left, lnr is now known as lnrdo, hobbified joined 06:09 nightfro` is now known as nightfrog 06:11 jjido left 06:12 dg joined, nine joined 06:13 psch joined, zdm left 06:14 _mg_ joined, chris2 joined 06:15 go|dfish joined, Gothmog_ joined 06:16 cyberviking_ joined 06:18 retupmoc_ joined 06:19 khagan joined 06:21 orbus_ joined, jsimonet joined 06:25 pierrot joined 06:27 BuildTheRobots joined, tim__ joined 06:31 firstdayonthejob joined, nakiro joined 06:41 ugexe joined 06:43 Xliff_ joined, TreyHarris left 06:45 TreyHarris joined 06:46 Xliff__ left 06:47 abraxxa joined 06:48 firstdayonthejob left
Woodi_ hi today :) 06:49
06:49 wamba joined 06:50 SmokeMachine____ joined, chansen_ joined
Woodi_ sortiz: NativeLibs concept looks nice and general ? can it be moved out of DBlish ? but so fur using it in method new() looks a bit complicated... 06:56
teatime how come people seem to prefer 'returns ___' over '--> ___' ? 06:57
Woodi_ teatime: becouse ppls didn't hear about --> ? :) 06:59
06:59 boegel joined
teatime in fact I haven't seen anything use --> (not that I've looked hard), even though it makes much more sense to me to, forced to choose, group the return type inside the parens w/ the arguments and arg types, rather than grouping it w/ the roles and traits and stuff. 07:00
although I suppose in p6 there are other things that makeup part of the signature outside of the parens 07:01
07:04 nebuchad` is now known as nebuchadnezzar, jnap joined 07:07 notostraca is now known as TEttinger
teatime OH, ACCEPTS is how you say whether __ ~~ YourObj smart-match passes/fails! 07:11
07:13 cyberviking_ left 07:16 cyberviking joined 07:20 zakharyas joined
ufobat what if a role uses a class, whereas this class also does the role.. it seems for me it gives a infinite loop. 07:22
07:22 skarn joined
ufobat as an example: class Human does CanHaveHumenChildren and role CanHaveHumenChildren { has @.children; method make_children() {return Human.new() } }... class Wolf does CanHaveHumenChildren { .. like in romulus and remus.. } 07:22
moritz you need to predeclare Human before you can declare CanHaveHumenChildren like that 07:24
(though I would separate the functions of *having* and *producing* children into separate roles :-) 07:25
or even better, make a role ProducesOffsprint[::T] { method make_children($count) { T.new() xx $count } } 07:26
Woodi_ ufobat: I think roles are simpler things then classes (like interfaces in Java) and should be used as auxiliary behaviour blending method...
07:27 trnh joined
moritz and then class Human does ProducesOffsprint[Human] { ... } 07:27
07:33 nakiro left
ufobat my RealWorld example is, i have a object that is root of tree; this root and the nodes should get "tree-code" via the role. so the classes "Tree" and "Node" have only the code according to their use case 07:33
07:33 maddingu1 is now known as maddingue
ufobat thanks for your suggestions :-) 07:34
07:36 darutoko joined, aindilis` left 07:37 aindilis joined
moritz also it might be worth considering whether the tree should be a separate object 07:37
really depends on the use case 07:38
ufobat: also for a Tree role, you can just use self.new, because the role is going to be applied to the type that is the tree
ufobat ah! 07:39
so instead of Node.new i do self.. interesting, then i can leave out the use Node 07:40
moritz m: role Tree { has @.children; method alloc() { @!children = self.new() xx 2 } }; class DOM does Tree { }; my $d = DOM.new; $d.alloc; say $d.perl 07:41
camelia rakudo-moar 4f3f1c: OUTPUT«DOM.new(children => [DOM.new(children => []), DOM.new(children => [])])␤»
Woodi_ ufobat: I think roles should not try to replace OO programming. roles seems to take less keystrokes but OO is more general thing...
moritz Woodi_: huh? 07:42
ufobat otherwise i would have asked how i "predeclare Human"? would it be a class Node; role Tree { method make_node() }..
moritz Woodi_: roles are an aspect of OO
or a part of it
ufobat according to your suggesten i think my role is, as you required, a behavoir of a thing.. that it can have several children
moritz a part can't repalce the whole
Woodi_ moritz: ufobat++ example above :) typical classess like nodes are simulated via roles...
ufobat i've got a Node class as well. i just have the aspect of having nodes in the role 07:43
moritz ufobat: predclaration: class Human { ... }; role Foo { uses Human here }; class Human { actual implemenation }
ufobat: but that requires the predeclaration and the implementation to be int he same compunit (so, same file, usually)
ufobat because the node is a thing of its own, and the Root is a different thing of its own, with a own usecase or reason to live
moritz: which is not a great coding style to have it in the same file 07:44
Woodi_ root node isn't very different thing, IMO... 07:45
07:47 peteretep left, djbkd_ joined
ufobat ell. that depends on the use-case. assuming that the root of all is god and you say that the "root" is not really something special you probably are disliked by plenty of people ;) 07:48
anyway! i will reconsidder how i implement this, my idea just was to split the use-case-code from the tree-structure-code 07:49
07:49 parisba_ joined, trnh left 07:50 peteretep joined
ufobat maybe i just do class Tree is Node ... ;) 07:54
anyway... 07:55
Woodi_ ufobat: :) 07:57
07:58 ely-se joined
Woodi_ m: class Tree { has $.name; has Node $!root }; my $t = Tree.new(); 08:00
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5===␤Type 'Node' is not declared. Did you mean 'Code'?␤at /tmp/qFR8qKhD5r:1␤------> 3class Tree { has $.name; has Node7⏏5 $!root }; my $t = Tree.new();␤Malformed has␤at /tmp/qFR8qKhD5r:1␤------> 3class Tree { has $.name; ha…»
08:01 jack_rabbit joined 08:02 dakkar joined 08:05 Begi joined, Begi left 08:06 Begi joined, Begi left, cibs joined 08:07 Emeric joined
ufobat :( my "Node" has some attributes that should not be in the Tree.... 08:11
08:14 trnh joined, trnh left, trnh joined, rindolf joined 08:15 Woodi_ left 08:16 dalek joined, ChanServ sets mode: +v dalek
Emeric hey, #perl6 08:16
I'm playing with Perl6, and I'm wondering why :
m: my Duration $x .= new(12); say ($x + 6).WHAT; say ($x * 2).WHAT; say ($x - 6).WHAT; say ($x / 2).WHAT;
camelia rakudo-moar 4f3f1c: OUTPUT«(Duration)␤(Num)␤(Duration)␤(Num)␤»
Emeric Why does ($x * 2) is a Num, not a Duration ? 08:17
08:18 Xliff_ left, djbkd_ left 08:23 smls joined 08:25 rodarmor joined
smls jnthn: Are you here right now? 08:27
08:28 Woodi joined
smls .tell jnthn With yet another input data-set, my script segfaults even in its single-threaded version (i.e. without the .race), and this time valgrind has lots to say about it: gist.github.com/smls/a97fdb40c0b87...b5b789bf92 08:29
yoleaux smls: I'll pass your message to jnthn.
08:31 brrt joined 08:41 RabidGravy joined
RabidGravy Boom! 08:45
Emeric RabidGravy: Bam ! 08:46
08:49 _nadim joined 08:55 _nadim left 09:00 Xliff joined, zakharyas left
teatime Emeric: Hi. hehe, I put in a PR yesterday to fix that. There's an existing RT bug for it also. 09:04
masak m: my $x = Duraction.new(12); my $y = Duration.new(4); say ($x / $y).^name
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/SO66F11HRg␤Undeclared name:␤ Duraction used at line 1. Did you mean 'Duration', 'Junction'?␤␤»
09:04 ribasushi left
masak m: my $x = Duration.new(12); my $y = Duration.new(4); say ($x / $y).^name 09:04
camelia rakudo-moar 4f3f1c: OUTPUT«Num␤»
masak that one should be a Num (or an Int), IMO 09:05
teatime masak: see PR
masak ok, nice :0
:)
Emeric teatime: oh, nice ! thanks 09:06
teatime I had it return proper units, except wherever they were meaningless (Dur * Dur) or of a unit we don't have a type for (num / Dur, unit Hz), it just treats all args as seconds, and returns a Duration.
^^ there's only a couple of cases where that happens, so it seems like a reasonable way to DWIM? alternately, it could return a unitless num ('cause S02 says Dur's should happily become Rat in numeric context), or could die? 09:07
I plan to add either a warning for those cases, or return of a fail (not sure which?), and clean up the code / comments/units-documentation and clean up the test cases 09:08
so there'll be a revised PR.
masak / Emeric: Suggestions on above ^^ issues are more than welcome. and also Emeric you can read the comments beginning at github.com/rakudo/rakudo/pull/742/...06c4013R20 and tell me if it all makes sense to you. 09:10
(comment blocks beginning at line 20 & 78) 09:11
Emeric teatime: I'm just a beginner with Perl 6 :) but i'll take a look at it$
RabidGravy speaking of which there hasn't been someone come in here and made a righteous furore about some highly complex and technical detail of how rakudo does DateTimes for ages 09:12
masak teatime: I don't think either warning or fail is appropriate when the units aren't enough.
RabidGravy has the world ended and we didn't notice?
masak teatime: my standard use case for that is computing the standard deviation on Durations. for a while there, you legitimately have the unit Duration ** 2, but all you care about are Nums 09:13
teatime RabidGravy: lol. 09:14
RabidGravy: it doesn't seem very bad to me. 09:15
RabidGravy: it's simple, but at the same time someone clearly put thought into how to make it consistent and unambiguous.
masak: so you say -1 on warn'ing upon Dur * Dur and num / Dur ? 09:16
RabidGravy oh the way some people would have it, rakudo is strangling kittens in a darkened cellar every time someone uses a DateTime 09:17
teatime masak: you can always silence warnings or explicitly cast to a num type like Rat (which is what my warning would likely suggest.)
RabidGravy I'd also go for no warnings, those kind of things are quite common in the kinds of things I'm interested in 09:18
teatime RabidGravy: What's their objection? Admittedly, time/dates is notoriously hard to get correct so I may have overlooked some obvious flaw and been falsely impressed.
Emeric/ masak / RabidGravy: Are we all in agreement that Dur / Dur should return a unitless number? 09:19
RabidGravy teatime, I couldn't possibly begin to explain the perceived issues, I'm all like *yawn" and pretending I'm blonde when it comes up
09:19 ribasushi joined
teatime and masak / RabidGravy: since you guys seem to actually use Dur*Dur and num/Dur, what should those operations return... Dur, or unitless num ? 09:20
RabidGravy Num
or Rat
they can be coerced back if necessary 09:21
teatime ok; that's consistent w/ S02 (which I realized during this convo, my way isn't.) 09:22
thanks much!
psch: /whois Emeric 09:24
psch ...i don't know? :) 09:25
Emeric Hmm ?
teatime lol… I *wondered* why there were no /whois results on my core buffer.
RabidGravy don't you just hate that 09:27
chortle
09:28 peteretep left
teatime Would it be appropriate to submit patches against S32 (which barely mentions Dur) and perhaps a small one against S02 (to clear up minor contradictions), or are those docs final/end-of-life ? 09:29
09:30 parisba_ left, jnap left
RabidGravy people still do change them if things are unclear or just plain not going to happen 09:30
teatime cool. 09:31
09:32 m0ltar_ left, ocbtec joined 09:33 felher left, MilkmanDan left, Sgeo__ joined
RabidGravy which reminds me 09:33
09:33 Gothmog_ left, [Coke]_ left, krunen_ left, jolts left, vike left, tailgate left
RabidGravy I was going to check something 09:33
09:33 [Coke] joined, krunen joined 09:34 orbus_ left, Celelibi left, Sgeo_ left, agentzh_ left, azawawi joined
azawawi hi 09:34
09:34 vike joined 09:35 Gothmog_ joined
RabidGravy yo! azawawi! 09:35
09:35 g4 joined
azawawi gist.github.com/azawawi/9be2369cc4...7c411e570a # interesting infinite recursion :) 09:36
09:36 peteretep joined
azawawi RabidGravy: ping :) 09:36
RabidGravy I see your GH streak is coming along nicely ;-) 09:37
09:37 jolts joined, jolts left 09:38 Sgeo_ joined
psch m: gist.github.com/azawawi/9be2369cc4...7c411e570a 09:38
09:38 jolts joined, jolts left, m0ltar joined, jnap joined
camelia rakudo-moar 4f3f1c: OUTPUT«(timeout)Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar␤Foo.bar…» 09:39
psch oh duh, the class implements the method
i had thought it should complain about the stub, but of course it shouldn't...
azawawi psch: it does when you add something before !!! 09:40
09:40 Celelibi joined, Sgeo__ left
psch m: gist.github.com/peschwa/372ef1685d...7262d59330 09:41
camelia rakudo-moar 4f3f1c: OUTPUT«Foo.bar␤stub soon␤Stub code executed␤ in method bar at /tmp/nDVWW524nn line 8␤ in method bar at /tmp/nDVWW524nn line 19␤ in block <unit> at /tmp/nDVWW524nn line 23␤␤»
psch huh
azawawi bug? :)
or by design
psch i'm not sure either way :)
azawawi or by design bug? :) 09:43
psch m: gist.github.com/peschwa/372ef1685d...7262d59330
camelia rakudo-moar 4f3f1c: OUTPUT«(method bar (Foo $: *%_) { #`(Method|72551824) ... },)␤»
09:44 jolts joined
psch m: gist.github.com/peschwa/372ef1685d...7262d59330 09:44
camelia rakudo-moar 4f3f1c: OUTPUT«(method bar (Foo $: *%_) { #`(Method|52461152) ... },)␤(method bar (Foo+{FooeyRole} $: *%_) { #`(Method|52461304) ... }, method bar (Foo $: *%_) { #`(Method|52461152) ... })␤»
09:44 jolts left 09:45 jolts joined, jolts left
psch i guess if there's only the stub it marks it as only-stub somehow..? 09:45
and thus the narrower invocant type doesn't get picked, because there is an alternative
but if it has more than the stub it gets picked because it's narrower and then dies
09:46 parisba_ joined
psch which does seem largely consistent with the design as i understand it vOv 09:46
09:46 tailgate joined 09:47 felher joined, hahainte1net is now known as hahainternet 09:48 orbus_ joined 09:49 jolts joined, jolts left 09:50 jolts joined, jolts left
RabidGravy looks at Net::OSC again, finds it still to be a bit stubby, puts implementing the Ardour control thingy for another month 09:50
I must not "adopt" any more modules 09:51
psch hah
i'm avoiding reading more midi spec :) 09:52
09:52 cyberviking left
psch there's also a bunch of papers i kinda want to read, but somehow not really... 09:53
the EuclidRhythm one for example heh
DrForr I'd love to play with generating Lilypond code... 09:54
09:55 jolts joined, jolts left 09:56 jolts joined, jolts left
RabidGravy DrForr, go for it, it's complex but regular 09:59
DrForr Well, the fun bit is that it's got Guile Scheme underneath it, which I've bound to Lisp. 10:01
10:01 jolts joined, jolts left 10:02 jolts joined, jolts left
RabidGravy I'll resurrect the standard midi file thing at some point, but I really, really must finish some of the other things I have started first 10:04
10:06 CIAvash left 10:08 brrt left, jolts joined, jolts left 10:09 jolts joined, jolts left 10:12 brrt joined 10:14 cibs_ joined, jolts joined, jolts left
RabidGravy though it does seem I have made a rod for my own back by getting round to the authentication part in Sofa last 10:15
10:15 jolts joined 10:16 jolts left 10:17 brrt left, cibs left 10:20 jolts joined 10:21 jolts left 10:22 jolts joined, jolts left 10:23 trnh left
psch m: enum Foo <A>; sub prefix:<A>($x?) { $x }; say A; say A1 10:24
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/lBXj5azl1o␤Prefix A requires an argument, but no valid term found␤at /tmp/lBXj5azl1o:1␤------> 3o <A>; sub prefix:<A>($x?) { $x }; say A7⏏5; say A1␤ expecting any of:␤ prefix␤»
psch right, i had that already i think...
psch ponders convenient Note creation syntax
10:25 Emeric left, TEttinger left 10:27 g4 left, jolts joined, jolts left 10:28 jolts joined, jolts left 10:29 jolts joined 10:30 MilkmanDan joined 10:36 vendethiel joined, avenj joined 10:38 vendethiel- left, agentzh joined
ufobat Woodi, moritz: this is my pain: github.com/ufobat/Bailador/blob/br...ing.pm#L38 with github.com/ufobat/Bailador/blob/br...dor/App.pm and github.com/ufobat/Bailador/blob/br...r/Route.pm 10:41
grondilu how can I pass a Pair as parameter without it being considered as a named parameter? 10:43
I could itemize it I guess but what else?
jnthn Extra parens around it
yoleaux 08:29Z <smls> jnthn: With yet another input data-set, my script segfaults even in its single-threaded version (i.e. without the .race), and this time valgrind has lots to say about it: gist.github.com/smls/a97fdb40c0b87...b5b789bf92
gregf_ my @lists = map { chomp; $_ } qx(find ./FILES_rptw -type f);my ($count, $id, $dir) = (0,1); 10:44
bah :/
of all the terminals i;ve got :| 10:45
sorry indeed
fortunately, the rest of the code was still at the prompt :)
i was going to checkout what Bailador was, but ended up right clicking :| 10:46
ZoffixWin m: sub foo (Pair $bar) { say $bar.key}; foo 'foo' => 'bar';
camelia rakudo-moar 4f3f1c: OUTPUT«foo␤»
ZoffixWin grondilu, when is it considered a named param? 10:47
jnthn Or that :)
ZoffixWin Ah, with :foo<bar>
jnthn All the cases with a naked name are considered named args
psch m: sub foo (Pair $bar) { say $bar.key}; foo foo => 'bar'; # this too
camelia rakudo-moar 4f3f1c: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤ in sub foo at /tmp/y6uQwe9NJI line 1␤ in block <unit> at /tmp/y6uQwe9NJI line 1␤␤»
ZoffixWin I see
psch that's the "naked name" case i suppose 10:48
jnthn Right, no quotes around the foo
psch m: sub foo (Pair $bar) { say $bar.key}; foo :"foo"<bar>
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/XoJVAuboYA␤Confused␤at /tmp/XoJVAuboYA:1␤------> 3b foo (Pair $bar) { say $bar.key}; foo :7⏏5"foo"<bar>␤ expecting any of:␤ colon pair␤»
psch i suppose that would just be crazy vOv
10:48 kaare_ joined
jnthn Not sure it'd win any beauty contests... :) Technically we could probably make it parse/work. :) 10:49
But when there's other ways to do it... :)
10:53 kaare_ left 10:54 cibs_ left 10:55 geekosaur left
psch m: sub prefix:<:>($x) { sub ($y) { Pair.new($x, $y) } }; say (:"foo")("bar") 10:55
camelia rakudo-moar 4f3f1c: OUTPUT«foo => bar␤»
psch ...almost :P
10:57 geekosaur joined
psch m: sub prefix:<:>($x) is assoc('left') { sub ($y) { Pair.new($x, $y) } }; say (:"foo")("bar") # huh 10:57
camelia rakudo-moar 4f3f1c: OUTPUT«===SORRY!===␤MVMArray: Can't pop from an empty array␤»
psch ...i'm not saying that what i'm doing is sensible, but the error still seems a tad LTA
jnthn No, I don't think assoc('left') on a unary makes any sense :P 10:58
10:58 cibs joined
jnthn You've no doubt confused the heck out of the operator precedence parser 10:58
Maybe something the assoc trait can catch 10:59
Shouldn't slow down parsing itself.
10:59 kaare_ joined 11:00 azawawi left
psch i was actually looking for something like "is tighter(&postcircumfix<( )>)", but we don't do invocation that way i think 11:00
masak assoc("left") on a unary does make sense. see S03.
prefixes and postfixes of equal precedence can form differently-shaped AST fragments. 11:01
the associativity of that precedence level governs which of the two possible shapes gets created.
11:01 cdg joined
masak implemented this last year in 007 :) 11:02
arnsholt Do you have an example? 11:04
masak there's no actual case in the core Perl 6 grammar, because all postfixes are tighter than all prefixes 11:06
11:07 zakharyas joined
arnsholt I meant in general, actually. I don't quite see what you mean 11:07
masak but let's say you defined both a prefix:<!> and a postfix:<!> locally, and gave them the same precedence
moritz !a! could be (!a)! or !(a!) 11:08
masak then `!$x!` could mean either `!($x!)` or `(!$x)!`
I said "see S03", because it's explained there
arnsholt Sure, sure
Oh, you did indeed. Should've checked that first, true
masak the former would be "associating to the left", the latter "associating to the right"
note that it's not *operators* that have associativity, but precedence levels 11:09
11:09 kid51 joined
masak unfortunately Perl 6 does not reflect that very well 11:09
arnsholt Ah, right 11:11
When thinking about the prec level being associative rather than the individual operators, it does make a lot more sense 11:12
Thanks!
masak pleasure. 11:14
11:14 CurtisOvidPoe left, cdg left
ufobat classicprogrammerpaintings.tumblr.c...brandt-van 11:15
masak ufobat: that one has already been done (no pun intended) to death 11:18
11:18 arlenik left
ufobat i must say the perl6 is by far not one of the good ones on classicprogrammerpaintings.tumblr.com/ 11:19
masak also "Perl 6 is dead" is just so 2006
ufobat i like the git rebase --interactive one
11:22 ruoso left 11:23 au left, au joined, dakkar left 11:24 brrt joined 11:25 Xliff left, Xliff joined
masak enjoyed "java.util.Date" by Salvador Dalí 11:26
11:29 ruoso joined, japhb joined
ufobat docs.oracle.com/javase/6/docs/api/.../Date.html dosn't look so bad 11:30
11:31 leedo left, leedo joined 11:36 [Tux] joined 11:37 jamesneko joined
masak ufobat: well, you should probably start over at docs.oracle.com/javase/6/docs/api/...endar.html 11:37
11:39 btyler joined
masak also, for fun, try to guess the value of Calendar.JANUARY 11:39
11:39 btyler left
psch guesses 11 11:40
11:41 pmurias joined
masak and if you're not disgusted yet, try guessing what .toString on a Calendar object will return 11:41
11:42 silug joined 11:43 luis joined
ufobat january is the 0th month of course ;D 11:43
11:43 _nadim joined
jnthn masak: Well volunteered to patch EXPR, then :) 11:44
ufobat :( 11:45
masak jnthn: ...to bring EXPR to spec? :)
jnthn: anyway, it wouldn't be a big fix, so I don't mind being accidentally volunteered to it.
11:45 rindolf left
masak EXPR doesn't scare me much anymore. 11:46
jnthn masak: Well, since you understand it already... :-)
masak right.
here's the (passing) test for it in 007: github.com/masak/007/blob/7c51a89c...#L425-L449 :) 11:47
and here's the code that handles it: github.com/masak/007/blob/7c51a89c...#L389-L396 11:48
so, not much.
11:49 sue joined 11:50 nadim joined 11:51 rindolf joined 11:54 _nadim left 11:55 kid51 left, nadim left 12:04 kent\n left, RabidGravy left, felher left 12:05 felher joined, aindilis left, kent\n joined, kent\n left, kent\n joined 12:06 ChoHag left, ChoHag joined 12:07 awwaiid left, aindilis joined 12:08 awwaiid joined 12:09 RabidGravy joined
RabidGravy eugh 12:09
12:10 leedo_ joined, sue left, [Tux] left, leedo left, brrt left, zakharyas left, avenj left
psch ...listening to what the example for Music::Helpers produces is much more fun than writing tests /o\ 12:13
12:16 diegok left, diegok joined, maddingue left 12:17 maddingue joined 12:23 [Tux] joined
RabidGravy psch, yeah I've found that 12:23
12:24 gtodd1 left 12:25 gtodd joined
ufobat i know i've asked this question already today.. but after thinking about it a while i still dont see how to get this working: pastebin.com/yEq4pF1w 12:25
12:25 zakharyas joined, sue joined
ufobat how to arange the use / modules, or what's a better design? 12:26
this gives a infinite loop
OH! my god is not a creatorofhuman!
but that doesnt matter..(much)
12:28 dakkar joined
RabidGravy well, for a small, well defined case I would put them in the same file and predeclare some stub as necessary 12:29
12:31 domidumont joined
ufobat and without putting them in a single file :( 12:31
i dont want the same code twice, just because i couldn't put it in a role :( 12:32
masak ufobat: I think you have to come to terms in some way that you're at odds here with a pretty fundamental requirement in Perl 6 parsing.
ufobat: right now it looks like you're beating your head against the limitation, instead of looking to work within its bounds
RabidGravy there are plenty of options, some less attractive than others, ranging from another role, through a parameterised role to run-time require and type lookup 12:33
ufobat masak, right, but go ahead. 12:34
masak ufobat: I once wrote a p6l email about this. let me try to find it for you.
ufobat i didnt get it working with a parameterised role either :/
thank you
pmurias rakudo-js mini-blog-post: blogs.perl.org/users/pawel_murias/2...akudo.html
12:35 sufrostico joined
RabidGravy but if the things are so tightly coupled as your code shows then the single file option is probably the best 12:35
ufobat RabidGravy, me runtime require didnt work either.. :( and the worst of all options, i think, is code duplication.. which i don't like to try
RabidGravy I'm not describing anything which would require duplication 12:36
12:37 Sgeo_ left
ufobat i just dont see the way out, yet :-( 12:38
jnthn pmurias: You did try to build up an array of strings a join them, rather than actually doing lots of concats, yes?
ufobat i guess my problem is more the design then the limitations of perl6, but as masak said, i am beating my head against it right now 12:39
RabidGravy, my RL example is github.com/ufobat/Bailador/blob/br...ing.pm#L38
ufobat feels stupid right now 12:40
masak ufobat: www.nntp.perl.org/group/perl.perl6....33141.html
ufobat: please read my OP and TimToady's reply 12:41
ufobat masak, thank you very much :)
jnthn ufobat: Bailador::Routing is a role composed by Bailador::Route. Presumably since it's a role it's intended to be composed in to other things. Is hard-coding a .new call to Bailador::Route therefore the right thing, or should it be self.new so to the role creates the appropriate instance of whatever it's composed in to? 12:43
12:43 domidumont left
awwaiid ufobat: I'm not sure if your circular dependency is the same as one I ran into in Inline::Ruby, but I had an RbObject that has-a RbValue, but sometimes RbValue needs to generate an RbObject. So in RbValue I had to use ::('Inline::Ruby::RbObject').new 12:43
RabidGravy jnthn, that is almost exactly what I would going to say
jnthn A role that explicitly names a class that's composing it is usually a design smell.
masak guess TimToady means `CHECK time` in his answer, not `CATCH time`... 12:46
ufobat aye! bailador::App uses the role as well, and never the less, if i parameterisize the role, its the same. what i wanted to do is acutally putting the "tree-code" out of the 2 classes that then just contain "use case code".
self.new isn't doing the job in my case, since Bailador::App is also doing the role. App is the root-node whereas all B::Route are regular nodes 12:47
awwaiid, ::('Inline::Ruby::RbObject').new <- :-) looks ugly but i think it might do the thing 12:48
12:48 domidumont joined 12:51 mls joined
jnthn OK, then role Bailador::Routing[::RouteType] { ... RouteType.new } would probably do it then 12:53
ufobat i tried that, but i think it broke at class ailador::Route is Bailador::Routing[Bailador::Route] 12:54
not 100% sure right now :(
right: at /home/martin/.workspace/p6/Bailador/lib/Bailador/Route.pm:5 12:58
Exception details:
Could not find symbol '&Route'
masak m: my &say-uc = method (Str $self:) { say $self.uc }; "oh hai".&say-uc; 42.&say-uc # methodicals! 12:59
camelia rakudo-moar 4f3f1c: OUTPUT«OH HAI␤Type check failed in binding $self; expected Str but got Int (42)␤ in method <anon> at /tmp/OVyIgxEWWV line 1␤ in block <unit> at /tmp/OVyIgxEWWV line 1␤␤»
12:59 cdg joined, cdg left
ufobat github.com/ufobat/Bailador/blob/bo...r/Route.pm 13:00
Ulti whoa 1.96s for my tests was 2.5s for a while during the optimisation push :3 so >300x speed up since rakudo on moarvm
13:00 cdg joined
jnthn I'm not quite sure how to get 300x out of 1.96s vs 2.5s ;) 13:02
Ulti 1.96s vs 10m
RabidGravy "special maths"
13:02 sufrostico left
Ulti there was a jump of 10m down to 30s quite quickly after moarvm 13:02
was at 10s for ages
I should really work out what the improvements are that made my use case 13:03
could probably git bisect in some way
go far enough back though and the profiler doesnt exist :3
pmurias jnthn: haven't tried using join 13:04
jnthn pmurias: Ah. That'd probably win.
pmurias: Strings are immutable, so naively repeated concatenation is quadratic.
Ulti 2014-08-22 was 35s 13:05
thats the oldest profile I have also
2015-04-14 11s 13:06
13:08 geekosaur left, geekosaur joined 13:09 nakiro joined 13:10 Sgeo_ joined
pmurias jnthn: I'll try that after I finish up my freshly discovered pile of things that need to be implemented for BOOTSTRAP 13:10
jnthn: the write to disk works suprisingly well on moarvm 13:11
jnthn pmurias: Yeah, which is nice, though I'd be a tiny bit surprised if it beat a join :) 13:12
psch m: sub trait_mod:<is>(Mu \r, :$it!) { r does { method foo { "bar" } } }; role R is it { }; class C does R { }; say C.new.foo 13:14
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/bCvzbnhOQg␤Cannot use 'does' operator with a type object.␤at /tmp/bCvzbnhOQg:1␤»
psch m: sub trait_mod:<is>(Mu \r, :$it!) { r does { method foo { "bar" } } }; role R is it { }; class C is R { }; say C.new.foo
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/V8CbFpITME␤Cannot use 'does' operator with a type object.␤at /tmp/V8CbFpITME:1␤»
psch m: sub trait_mod:<is>(Mu \r, :$it!) { r but { method foo { "bar" } } }; role R is it { }; class C does R { }; say C.new.foo
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/MXAJ1Vgte7␤Could not instantiate role 'R':␤Cannot invoke this object␤at /tmp/MXAJ1Vgte7:1␤»
psch ...well, at least it's a different failure mode than the un-golfed, local one hah 13:15
13:17 sufrostico joined, domidumont left, frederico left, autarch1 left, infina left, [ptc] left, infina_ joined, domidumont joined, infina_ is now known as infina, infina left, infina joined, nchambers joined, Woodi left, brabo left 13:18 Woodi joined, brabo joined, ssm joined, frederico joined, BooK joined, ashleydev joined 13:19 raydiak_ joined 13:20 autarch joined 13:21 [ptc] joined 13:22 b2gills joined, Sgeo_ left
gregf_ m: my Int $foo = 100; say $foo.id 13:23
camelia rakudo-moar 4f3f1c: OUTPUT«Method 'id' not found for invocant of class 'Int'␤ in block <unit> at /tmp/bDVdu8dtoA line 1␤␤»
gregf_ is there a way to get a unique id for a variable?
like so, in Ruby one can do: foo = "bar"; p foo.__id__ #strings only 13:24
psch .WHICH is unique i think, but i don't think it's guaranteeed not to change..?
teatime you can do .WHICH, but for 'value types' these won't be unique.
but that shouldn't matter precisely because of the semantics. 13:25
psch oh, right, value types aren't unique under WHICH
teatime there's also .WHERE
psch yeah, that's what i was thinking of
13:26 edjsu joined
gregf_ hmm 13:26
m: my Str $a = "foo"; say $a.WHICH; $a ~= "bar"; say $a.WHICH;
camelia rakudo-moar 4f3f1c: OUTPUT«Str|foo␤Str|foobar␤»
psch m: role R { method f { self.^shortname } }; role R1 is R { }; class C does R1 { }; say C.new.f
camelia rakudo-moar 4f3f1c: OUTPUT«C␤»
psch m: role R { method f { self.^shortname } }; role R1 is R { }; class C { submethod BUILD { self does R1 } }; say C.new.f 13:27
camelia rakudo-moar 4f3f1c: OUTPUT«C+{R1}␤»
Woodi pmurias: in blog, looks you could turn every sentence into separate paragraph, if you want... anyway, post is packed with informative and happy news :)
13:27 sftp joined
jnthn .WHERE can change over an object's lifetime 13:27
.WHICH will not for non-value types 13:28
masak pmurias made a blog post? where? :)
jnthn m: class A { }; my $x = A.new; say $a.WHERE; say $a.WHICH; A.new xx 50000; say $a.WHERE; say $a.WHICH 13:29
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/lay38XVPme␤Variable '$a' is not declared␤at /tmp/lay38XVPme:1␤------> 3class A { }; my $x = A.new; say 7⏏5$a.WHERE; say $a.WHICH; A.new xx 50000; ␤»
teatime gregf_: if you say what you want it for, could probably tell you which thing to use. there are several different things you could mean.
jnthn m: class A { }; my $a = A.new; say $a.WHERE; say $a.WHICH; A.new xx 50000; say $a.WHERE; say $a.WHICH
camelia rakudo-moar 4f3f1c: OUTPUT«139742684822992␤A|84851648␤84851648␤A|84851648␤»
jnthn The .WHERE changed over time, but the .WHICH did not
masak the .WHERE changed due to GC generational things? 13:30
13:30 woodruffw joined, woodruffw left, woodruffw joined
gregf_ teatime: i'm just checking for string immutability :) 13:30
masak compared to the 50_000 doomed kids, the A.new in $a is now considered a geezer? 13:31
13:31 g4 joined, g4 left, g4 joined
jnthn masak: Well, mostly that we have a copying GC more than the generational bits 13:31
psch m: role R { method f { self.^shortname } }; role R1 does R is export { }; class C is export { submethod BUILD { self does R1 } }; say C.new.f 13:32
camelia rakudo-moar 4f3f1c: OUTPUT«C+{R1}␤»
psch i *think* that's the gist of what i'm trying to do with role sus2 does for-naming is export { }
jnthn masak: But yeah, if you .WHICH something that it moves to the old generation on the next GC run in the current implementation
psch role sus4 does for-naming is export { }
argh
with github.com/peschwa/p6-Music-Helper...rs.pm#L162
jnthn s/that/then/
masak jnthn: oh, interesting
psch but the code in the repo gives e.g.:
$ perl6 -Ilib -MMusic::Helpers -e'my @n = do [ Note.new(midi => $_ + 4 * 12) for C,E,G ]; my $c = Chord.new(notes => @n);say $c.Str'
jnthn masak: Basically because we get a stable object ID by predestining it to end up in a certain place inside of gen2 when its' promoted there :)
psch C4 E4 G4 ==> C4 maj} (inversion: 0)
and i have no clue where that one stray } comes from...
(not to mention that according to the camelia snippet it should print something else entirely 13:33
)
the Str method is in line 285, fwiw
jnthn masak: Other objects generally have to survive 2 collections before promotion, but .WHICH at present gets you an express trip to the old generation if you're still alive at the next collect. 13:34
pmurias masak: blogs.perl.org/users/pawel_murias/2...akudo.html 13:35
Woodi: future posts will contain more paragraphs
13:35 Sqirrel left
masak pmurias++ 13:36
pmurias: great to read about your progress! 13:37
gregf_ 13:40
bah :/
psch m: role Foo::Bar::ThisMightBeLong { method f { self.^shortname } }; class Foo::Bar::MoreLongStuffHere { submethod BUILD { self does Foo::Bar::ThisMightBeLong } }; say Foo::Bar::MoreLongStuffHere.new.f
camelia rakudo-moar 4f3f1c: OUTPUT«ThisMightBeLong}␤»
13:40 maybekoo2 left
psch aha! 13:40
m: role Foo::Bar::ThisMightBeLong { method f { self.^shortname } }; class Foo::Bar::MoreLongStuffHere { submethod BUILD { self does Foo::Bar::ThisMightBeLong } }; say Foo::Bar::MoreLongStuffHere.WHAT # even more so 13:41
camelia rakudo-moar 4f3f1c: OUTPUT«(MoreLongStuffHere)␤»
psch m: role Foo::Bar::ThisMightBeLong { method f { self.^shortname } }; class Foo::Bar::MoreLongStuffHere { submethod BUILD { self does Foo::Bar::ThisMightBeLong } }; say Foo::Bar::MoreLongStuffHere.new.WHAT # even more so
camelia rakudo-moar 4f3f1c: OUTPUT«(ThisMightBeLong})␤»
psch i'm not actually sure the length plays in there, though
13:42 ryand left
psch m: role R { method f { self.^shortname } }; class C { submethod BUILD { self does R } }; say C.new.WHAT # well, it is involved, apparently... 13:42
camelia rakudo-moar 4f3f1c: OUTPUT«(C+{R})␤»
psch guesses "shortname strips from ^ to last ::" 13:43
except if it knows there'll be a role
which it doesn't when BUILD does the does
13:46 darutoko- joined, dsp- joined, sue left 13:47 Actualeyes left, pierrot_ joined, autarch left, sufrostico left, peteretep left, Cabanossi left, Amnez777 left, molaf joined 13:48 sufrostico joined, autarch joined, Actualeyes joined, peteretep joined, awwaiid left, kaare_ left, krunen left, ocbtec left, psch left, nine left, k-man left, a3r0 left, dsp-_ left, krunen joined, kaare_ joined 13:49 nebuchad` joined, TreyHarr1 joined, smls left, darutoko left, TreyHarris left, ugexe left, pierrot left, apejens left, nebuchadnezzar left, gfldex left, psch joined, awwaiid joined 13:50 nine joined, apejens joined, gfldex joined 13:51 BuildTheRobots left 13:52 Cabanossi joined 13:54 nebuchad` is now known as nebuchadnezzar 13:55 skids joined, Amnez777 joined 13:57 a3r0 joined, ocbtec joined 13:58 ryand joined 13:59 BuildTheRobots joined 14:01 k-man joined 14:02 g4 left
RabidGravy oof 14:04
14:04 avenj joined, avenj left, avenj joined
psch anyway, what this comes from is that i have a bunch of roles that should help identify objects. the roles get applied during BUILD, and in .Str i want to use the name of a subset of those roles 14:06
i'm guessing (even ignoring the WAT above) that i'm not quite on the right track in the first place, because of all the name mangling i'd have to do anyway
gregf_ psch: are you applying that role to an instance? 14:07
psch gregf_: i am applying the roles to self at the end of BUILD, so "almost"..?
well, to make this more specific, i have a class Chord, for Music. during BUILD a Chord figures out if it's major, minor, etc. and applies the corresponding role. but a Chord can also be "sus-able", i.e. suspendable 14:10
which means it can have its 3rd diminished or augmented, which results in a new Chord without the min or maj role, but with the sus2 or sus4 role
and of course i'd like to not have to have a ' method chord-type { $chord-type } ' in every of those roles 14:11
where $chord-type is "min" for role min, "maj" for role maj, etc...
s/for Music/as in 'triad'/ # maybe... vOv
[Coke] what's in a minor or major role? 14:12
Is this something better modeled as an attribute?
psch maj has a method dom7, which returns a dominant 7th Chord
i'm not sure it works as attribute, but i am thinking what i'm doing here is kind of spaghetti design... 14:13
(min doesn't have that method, 'cause it wouldn't be a dom7 but a min7)
14:15 nd3i joined, khw joined
psch also, there's a finite set of possible chords, and different order of the same notes does (mostly...) still mean the same chord, albeit inverted 14:15
14:16 tharkun left
RabidGravy I think the Str thing might might be doable by getting the roles at run time 14:16
14:17 ugexe joined
psch right, but a Chord+{maj,sus-able} shouldn't report itself as e.g. C maj sus-able 14:17
14:17 mcsnolte joined, tharkun joined
psch that's what i'm struggling with to figure out 14:17
the fact that i have multiple roles applied to a class and one of them matters for stringification, but the other doesn't 14:18
and i don't think relying on ordering or so is reliable enough... vOv
RabidGravy does the role itself "know" whether it matters from stringification? Given the context? 14:20
14:21 cpage_ joined
[Coke] I wouldn't rely on the stringification of a thing to see what roles it has 14:22
psch well, i've tried that with a new role, that those that matter does
[Coke] I would ask it if it has a role I cared about.
RabidGravy so you get .^roles at run-time, then ask the role which has $?CLASS so it knows what context and returns the right thing 14:23
pmurias vendethiel: you commented ? on my nqp-js commit
psch .oO( sometimes Perl 6 keywords make for weird grammar... )
14:24 torbjorn joined 14:26 tokomer joined, kaare__ joined, kaare_ left 14:29 tim__ is now known as thowe
psch method chord-type { self.HOW.roles(self).grep({ $_ ~~ for-naming && $_ !=== for-naming })[0].^shortname } 14:31
that seems to do what i want
but it's kinda horrible
pmurias fixed a bug in MoarVM and made a pull request 14:32
nd3i given @a = [1 2 3 3 1 2], @a.grep(2) #=> [2 2] BUT I want the index for each match: [1 5] suggestions? 14:33
psch where for-naming is the role that gets applied to the roles that matter for the stringification of a Chord
nd3i I have this: gather for ^@a { take $_ if @a[$_] == 2 } but it seems there should be something shorter
psch m: say .grep: 2, :kv given [1, 2, 3, 3, 1, 2]
camelia rakudo-moar 4f3f1c: OUTPUT«(1 2 5 2)␤»
14:33 trnh joined
psch m: say [1, 2, 3, 3, 1, 2].grep(2, :kv) # probably more comprehensible 14:34
camelia rakudo-moar 4f3f1c: OUTPUT«(1 2 5 2)␤»
nd3i Thanks! I was thinking along those lines but couldn't figure where .kv would go. I'll play with those. 14:35
psch m: say [1, 2, 3, 3, 1, 2].grep(2, :p) # might be useful as well 14:36
camelia rakudo-moar 4f3f1c: OUTPUT«(1 => 2 5 => 2)␤»
psch m: say [1, 2, 3, 3, 1, 2].pairs.grep(*.value == 2) # alternatively... 14:37
camelia rakudo-moar 4f3f1c: OUTPUT«(1 => 2 5 => 2)␤»
14:38 djbkd joined
nd3i Oops. ":kv" is new for me. That's an adverb, right? 14:38
14:39 sue joined
nd3i I have to read up on how that works at that spot. 14:39
moritz nd3i: it's a named argument to the method here
nd3i: same as kv => True
psch never was quite sure when we call named arguments adverbs
jnthn Because a sub/method call is a verb :)
moritz psch: maybe when they're boolean? 14:40
pmurias vendethiel: that commit will be useful for paste.debian.net/432747/
nd3i OIC, so grep is taking it as an option
moritz right
14:40 trnh left
nd3i got it--thanks. 14:40
psch moritz: that does seem to make more sense than "when the sub call looks operator-ish", which was my best guess 14:41
like @a[1]:exists
moritz well, in those cases, the grammar actually parses it as an adverb
there are special rules for that
psch ...that actually just makes me more confused again :)
because if adverbs are specially parsed as such - and named arguments never are - then we should never call named arguments adverbs 14:42
but then, subs and method calls are verbs, as jnthn says
moritz psch: I kinda agree
semantics!
linguistics!
jnthn But pragmatics lets us have different semantics when we feel like it :P 14:43
14:43 huf_ is now known as huf
psch language is hard, let's listen to instrumental music :P 14:44
14:44 trnh joined
nd3i would it be perl without "we have special rules for that"? /s 14:45
14:45 mohae joined
gtodd hmm if there was a super trivial way to publish "Top 40 perl6 REPL Hits!" to asciinema.org/ what would they be ? :-) 14:45
perlpilot nd3i: Perl 6 has made an effort to reduce the number of special rules. 14:46
RabidGravy psch, I mostly do :)
gtodd I like how the screen can be cut and pasted :-P
RabidGravy right now for instance soundcloud.com/mixmag-1/premiere-h...awan-remix 14:47
pmurias nd3i: Perl 6 tries to replace the special rules with general ones ;)
14:47 nchambers is now known as MrKrabs
RabidGravy which is good as my memory can't deal with *more* special rules 14:47
perlpilot RabidGravy: you just think that's true. Really you just need to train your brain. 14:48
nd3i so values from b based on indexes from a: @b[@a.grep(3,:k)] #=> (100 11)
works great! Thanks again.
14:50 nd3i left, sufrostico left
jnthn gtodd: yowser, I read that as ASCII enema at first :P 14:51
psch RabidGravy: well, i'm obviously still listening to the same piano improv... vOv
i do occassionally change the root or mode, though :P
pmurias jnthn: sounds painful 14:52
RabidGravy but look on the bright side you can't get a thorn in ASCII 14:53
14:54 MrKrabs is now known as nchambers
moritz
.oO( Hackathorn )
14:55
.u thorn
yoleaux U+00DE LATIN CAPITAL LETTER THORN [Lu] (Þ)
U+00FE LATIN SMALL LETTER THORN [Ll] (þ)
U+16A6 RUNIC LETTER THURISAZ THURS THORN [Lo] (ᚦ)
jnthn Out of ASCII range :)
moritz Hackaþ
jnthn :D
RabidGravy psch, I wanted sliders in Gtk::Simple the other day to be able to change things on the fly 14:56
gtodd heheh 14:57
14:57 tharkun left, tharkun joined 14:58 domidumont left 14:59 domidumont joined
timotimo sorry about gtk::simple not having sliders yet 15:00
RabidGravy the moment passed, no-one got hurt :) 15:01
psch RabidGravy: yeah, i think i saw that. i've more though that i'd like to have something like a alcd - as in, a algorithmic live composition daemon - that i can nudge with tempo and all those kinda things... 15:02
but that's probably more of a topic for current research than something that i can hack together in a few weeks :P
RabidGravy sounds like you want to make a supercollider client 15:03
psch maybe 15:04
i think i'll stick with throwing stuff through Audio::PortMIDI for now though
maybe even actually implement proper SysEx support eventually :P
timotimo what is SysEx?
psch timotimo: system exclusive messages 15:05
timotimo: for stuff like "hey, tb-808, you have to the secret roland cowbell now"
via MIDI, of course
timotimo ah
psch +do
15:06 ely-se left
psch seriously though, music 15:08
3rd inversion of a maj6 chord is a dom7 chord
/o\
15:09 cdg_ joined
psch oh, it actually isn't, i misspoke. it's a minmaj7 vOv 15:10
15:10 cdg left 15:12 sufrostico joined
nine 20 years of listening to this Babylon 5 soundtrack and I still get goosebumps. Amazing. 15:12
psch (i was still wrong, C E G A is a maj6, and thrice inverted it's A C E G, which is a min7...) 15:17
15:19 djbkd left 15:26 sue left 15:35 mst joined
RabidGravy I hate it when you look at your own code and think "ooOOooooh that should just work" only to find it doesn't 15:36
15:38 domidumont left 15:41 nakiro left 15:48 trnh left 15:50 trnh joined, trnh left, trnh joined 15:51 domidumont joined 15:52 mst left, mst joined, domidumont left, domidumont1 joined, trnh left 15:56 trnh joined 15:57 pmurias left 16:00 abraxxa left, ptolemarch joined 16:02 gfldex left 16:05 Philj joined
Philj Hello :) 16:05
16:07 _mg_ left
nine Hi Philj 16:07
Philj Just tried reqwriting an old script of mine perl6, and found a few performance issues. I did some benchmarks and perl6/rakudo seems to really struggle with long lines of text (in this case lines are about 16mb) A simple while loop through a 4 line file saying "line" at each line takes ~1 minute. 16:09
Is this normal?
nine This has been fixed very recently
jnthn Yeah, was within the last couple of weeks 16:10
Philj Ah ok, I am running on rakudo-star-2016.01
Will I have to have to pull from github for this - I can only see rakudo-star-2016.01 on perl6.org/downloads/ ? 16:12
nine Philj: git clone github.com/rakudo/rakudo && cd rakudo && perl Configure.PL --gen-nqp --gen-moar --backends=moar --make-install 16:14
Philj Thanks <nine> 16:15
16:17 gfldex joined
[Coke] I thought we had star releases since 2016.01 16:20
why are they not on rakudo.org/downloads/star/ ?
am I misremembering? 16:21
16:27 ilmari_ is now known as ilmari 16:28 ilmari is now known as ilmari_, ilmari_ is now known as ilmari 16:29 vendethiel left 16:30 vendethiel joined 16:34 Actualeyes left, cyberviking joined
timotimo [Coke]: i started work on a star for .03 16:38
but i didn't finish it yet
16:38 sortiz joined 16:40 cyberviking left, cyberviking joined 16:43 dakkar left, nige1 joined 16:44 cyberviking left 16:48 sufrostico left
[Coke] www.independent.co.uk/life-style/ga...84256.html 16:49
sortiz \o #perl6
nine [Coke]: staggering display of incompetence 16:51
mst nine: on the part of the independent for doing exactly zero fact checking 16:52
mst read the original SO post, smells of /r/thathappened
16:55 lizmat joined, nige1 left 16:58 ZoffixW joined
timotimo heh. 16:58
ZoffixW That post is utter bollocks. If your read OP's comments on the answers, they apparently also ran `dd` to mess up all of the proposed suggestions to recover. Total troll.
on SO answers that is 16:59
Are advanced wrap tests supposed to be failing? I get 3 failures WITHOUT my patch: gist.github.com/zoffixznet/3df481e...9fdbdde0c0 17:00
And when I add my seemingly unrelated patch, I get one more failure: gist.github.com/zoffixznet/2c1e817...465f622a73 17:01
(the patch being the #743 PR)
sortiz From my backlog: I found that as soon as NativeCall::cglobal returns, the loaded native library is unloaded, so cglobal("somelib", "somesym", Pointer) returns a Pointer pointing to limbo, see: github.com/MoarVM/MoarVM/blo​b/mas...ll.c#L622, comments? 17:03
El_Che "The problem command was "rm -rf": a basic piece of code that will delete everything it is told to." 17:05
the wording is priceless
"the r deletes everything within a given directory" (and wrong)
ZoffixW heh
El_Che after the that I gave up and stopped reading :) 17:06
17:06 sufrostico joined
ZoffixW Hey. Reporting isn't about correctness. It's about writing clickbait articles and salting them with many ads 17:06
17:06 _mg_ joined
ZoffixW Yesterday, I've read an "article" literally about someone posting "Going to bed" on Twitter and 7 years later also tweeting "Crap, I overslept." There must've been at least 30 ads on it. 17:08
17:08 xinming joined
ZoffixW And the title was something along the lines of "This dedicated dude waits 7 years before just to tweet AN AWESOME JOKE!!" 17:08
m: "blo​b".uninames.say 17:09
camelia rakudo-moar 4f3f1c: OUTPUT«(LATIN SMALL LETTER B LATIN SMALL LETTER L LATIN SMALL LETTER O ZERO WIDTH SPACE LATIN SMALL LETTER B)␤»
ZoffixW Here's fixed URL for sortiz's issue: github.com/MoarVM/MoarVM/blob/mast...all.c#L622
sortiz ZoffixW++ # Thanks. 17:12
gtodd neat SO article .... I want a small company with 1500 customers 17:13
17:14 firstdayonthejob joined
gtodd my CV: - familiar with "rm -rf" 17:14
ZoffixW that joke drops jaws 17:15
ZoffixW I gotta go... But if anyone knows the answer to my question above, I'll read the backlog. 17:16
17:16 ZoffixW left
gtodd wait a sec ... is ZoffixW coming back in 7 years? .... omg that would drop jaws 17:17
17:17 TreyHarris joined 17:20 trnh left, TreyHarr1 left, woodruffw left, leedo_ left, felher left, ruoso left, ruoso joined 17:21 sufrostico left, gfldex left, apejens left, b2gills left, frederico left, agentzh left, MilkmanDan left, jolts left 17:22 b2gills joined 17:23 jolts joined, jolts left 17:24 jolts joined 17:25 jolts left, woodruffw joined, woodruffw left 17:26 woodruffw joined, woodruffw left, woodruffw joined, woodruffw left, leedo joined 17:27 frederico joined, woodruffw joined, zakharyas left 17:28 sufrostico joined, gfldex joined 17:29 jolts joined, jolts left 17:30 jolts joined, jolts left, apejens joined 17:31 Timbus joined 17:33 lizmat left 17:34 felher joined 17:35 jolts joined, jolts left 17:36 jolts joined, jolts left 17:38 teatime left 17:40 trnh joined, jolts joined 17:41 jolts left, pierrot_ is now known as pierrot 17:42 jolts joined, jolts left 17:48 hanekomu joined, vendethiel- joined 17:50 [ptc] left, infina left, infina_ joined, infina_ is now known as infina, infina left, infina joined, vendethiel left, ashleydev left 17:51 [ptc] joined, trnh left, krunen left, mre left, mre joined, krunen joined 17:52 trnh joined, ashleydev joined 17:53 trnh left, tadzik left 17:54 M-matthew left
RabidGravy Is there any example in the core or otherwise of applying a role to a multi which implements the CALL-ME? 17:56
17:56 teatime joined 17:59 M-tadzik joined 18:00 M-matthew joined 18:07 nige1 joined 18:08 jolts joined, jolts left
ugexe m: role Bar { multi method CALL-ME(Int $int) { say "Int"; }; }; class Foo does Bar { proto method CALL-ME(|) {*}; multi method CALL-ME(Str:D $str) { say "Str:D"; }; multi method CALL-ME(Str:U $str) { say "Str:U"; }; }; Foo(1); 18:12
camelia rakudo-moar 4f3f1c: OUTPUT«Int␤»
ugexe i imagine it might get messy if you apply roles with `but RoleName($attr)` syntax though 18:13
18:15 gmeniel joined 18:16 vendethiel joined 18:17 MilkmanDan joined, vendethiel- left 18:18 tokomer left, raoulvdberge joined 18:21 cyberviking joined
RabidGravy nah, what I'm trying to do is 18:22
m: role Zub { method CALL-ME(Mu:D $self) { } }; multi sub trait_mod:<is> (Method $m, :$foo!) { $m does Zub; }; class Foo { multi method bar() is foo { }; multi method bar(Int $o) is foo { }; }; Foo.new.bar(1);
camelia rakudo-moar 4f3f1c: OUTPUT«Cannot invoke object with invocation handler in this context␤ in block <unit> at /tmp/Q8V90bmzZj line 1␤␤»
RabidGravy to provide the implementation of the method
which er fails like that 18:24
vendethiel pmurias: okay, thanks. was pretty surprised still, looks like an infinite loop
18:24 khw left 18:26 agentzh joined, erdic joined 18:27 cdg_ left 18:32 diakopte1 is now known as diakopter 18:50 agentzh left, cyberviking left 18:51 _mg_ left, MilkmanDan left 18:53 gmeniel left 18:57 cale2 joined 19:08 rindolf left 19:12 spanner__ left, Guest95484 left
RabidGravy m: gist.github.com/jonathanstowe/8642...5d4420aebb 19:18
camelia rakudo-moar 4f3f1c: OUTPUT«Cannot invoke object with invocation handler in this context␤ in method bar at /tmp/jePB4SIzaK line 14␤ in block <unit> at /tmp/jePB4SIzaK line 22␤␤»
RabidGravy I'm going to RT that unless someone says not to 19:19
mst bites tongue to avoid being difficult for comedy value 19:21
19:23 geekosaur left 19:24 geekosaur joined
jnthn RabidGravy: It's probably already in there... iirc it's the same reason you can't "is native" a multi 19:25
19:26 spider-mario joined
RabidGravy it would be yeah 19:26
jnthn I think the history of it was something like "Shall I CPS-transform-by-hand more C code or hope this never happens? Screw it, let's try the easy approach first..." 19:27
RabidGravy yeah I looked at frame.c where it is actually going wrong and looks hairy 19:28
19:34 sufrostico left 19:35 sufrostico joined
nine I don't know why, but I'm kinda scared that sharing mast frames with the outer compiler actually works. 19:41
RabidGravy the problem with RT is it doesn't search the bodies 19:42
[Coke] pretty sure you can search the ticket bodies.
nine RabidGravy: it could actually but that has to be enabled on the server as full text indexing is very SQL server specific
[Coke] checking...
RabidGravy stick elastic search in and you're good to go 19:44
19:45 domidumont1 left, ranguard_ is now known as ranguard
[Coke] nine++ 19:45
sorry, I misremembered. ETOOMANYticket systems. 19:46
I think rt.perl.org/Search/Simple.html?q=f...xt%3Aslurp is suggested to work, but doesn't.
19:47 MilkmanDan joined
nine Enabling full text search should be easy: docs.bestpractical.com/rt/4.2.12/f...exing.html 19:48
RabidGravy only one ticket with the same approximate cause 19:49
rt.perl.org/Ticket/Display.html?id=122899
[Coke] nine: note that we're on 4.0.18 19:50
I'll ask them if we can turn it on. 19:51
nine [Coke]: seems to be just the same: 4.0.18/full_text_indexing.html
docs.bestpractical.com/rt/4.0.24/f...exing.html
Oh I just hate that chromium pretends to select the full URL on click to the URL bar while the primary selction actually stays unchanged
19:52 nowan joined
geekosaur um, it uses a modern gui toolkit. it doesn't *do* PRIMARY 19:54
19:54 agentzh joined, agentzh left, agentzh joined
geekosaur just like every other program based on gtk or qt 19:54
or fltk or ...
grondilu m: constant ∞ = Inf 19:55
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7unsDG_zYE␤Missing initializer on constant declaration␤at /tmp/7unsDG_zYE:1␤------> 3constant7⏏5 ∞ = Inf␤»
nine geekosaur: qt does primary just fine
geekosaur have not actually checked but that surprises me a bit. gtk certainly ignores the existence of PRIMARY completely, using only CLIPBOARD which wants a control-c (cmd-c on mac) to actually set the selection 19:56
[Coke] nine, RabidGravy: request sent.
RabidGravy cool
I think I'll RT this with a link to the other one (is cached could be implemented differently I guess) then if it is a dupe someone can merge later 19:58
jnthn RabidGravy: +1 19:59
RabidGravy then I'll work out how to do what I'm trying to do another way 20:00
ufobat where is CALL-ME documented? its not in doc.perl6.org/type/Callable 20:05
20:11 kerframil joined
RabidGravy I'm not sure it is documented 20:13
20:13 darutoko- left
ufobat then there is no magic around it :-) thanks 20:16
20:17 kerframil left 20:18 kerframil joined
ufobat masak, i just read your mail and the replies.. i will do this again tomorrow on saturday and on sunday. It helped me to write a solution that works.. though i still don't like the code/design 20:19
20:20 kaare__ left
ufobat masak, thanks again for showing it to me :) 20:20
20:21 cdg joined
RabidGravy ufobat, doc.perl6.org/language/operators#po...ix_%28_%29 may be the only place in the documentation it is mentioned 20:21
20:22 agentzh left, MilkmanDan left
ufobat oh! thanks :) i guess only the signatures must match and off we go! 20:22
goodnight perl6 :-) perry rhodan is waiting for me! 20:23
RabidGravy yeah, typically you'd also make the type do Callable so it appears to be the right sort of thing
masak ufobat: you're welcome. I just thought it might be nice to know someone else has been asking the same questions. 20:28
MadcapJake quoting constructs are really hard to support syntax highlighting for 20:32
m: qw|! @ # $ % ^ & * \| < > | eqv '! @ # $ % ^ & * | < >'.words 20:33
camelia rakudo-moar 4f3f1c: OUTPUT«WARNINGS for /tmp/9mwonIeoPe:␤Useless use of "eqv" in expression "qw|! @ # $ % ^ & * \\| < > | eqv '! @ # $ % ^ & * | < >'.words" in sink context (line 1)␤»
MadcapJake m: say qw|! @ # $ % ^ & * \| < > | eqv '! @ # $ % ^ & * | < >'.words
camelia rakudo-moar 4f3f1c: OUTPUT«True␤»
MadcapJake I cannot, for the life of me come up with a regex that properly ends before the eqv
well I *can* but not with one requirement
«Delimiters can be nested» 20:34
If I just scrap that rule, everything's dandy, but if I try to capture nested, it thinks that the third and fourth | are internal to a Quote that hasn't finished yet :P 20:35
20:40 Ven_ joined
masak I don't think non-paired delimiters like | can nest 20:44
if they could, then what would be the difference between a nested, opening `|` and a closing `|`? :) 20:47
(and remember, you're not allowed to say "if there's a matching closer further on", because you're not allowed that kind of lookahead) 20:48
20:49 wamba left
MadcapJake m: say q< <p>this works</p> > # works as long as you don't place it right next to the delimiter 20:50
camelia rakudo-moar 4f3f1c: OUTPUT« <p>this works</p> ␤»
MadcapJake masak: ^^
geekosaur those are paired 20:51
< > is a paired set
| | is not
MadcapJake oh, I see you mean characters that are equivalent
ohh! I could probably make it work off that knowledge, thanks masak/geekosaur! 20:52
geekosaur yeh, there's just no way to disambiguate nesting of the open and close delimiters are the same
masak there's a real term, not "paired", that I forget 20:53
but yeah, it's about matching openers and closers
20:53 pmurias joined
pmurias vendethiel: maybe I should comment that line 20:54
Ven_ please do :)
20:56 cognominal_ left
MadcapJake masak, geekosaur: that was such a headache relieved! 20:56
one little line and it works
MadcapJake is close to finishing a highlight.js PR for a Perl 6 mode 20:57
20:58 skids left 20:59 M-tadzik is now known as tadzik 21:02 molaf left 21:06 dalek left
sortiz RabidGravy, my approach to your problem: gist.github.com/salortiz/0f869e259...2d0ba41e25 21:06
21:06 dalek joined, ChanServ sets mode: +v dalek 21:09 Ven_ left 21:10 Azry joined
RabidGravy hah, neat but what I'm actually trying to do is make github.com/jonathanstowe/Sofa/blob.../Method.pm be able to have candidates with args 21:12
grondilu how can a module override and export a symbol like ∞? I tried and failed :/ 21:13
Xliff rm -rf {foo}/{bar} 21:15
21:15 mst left, mst joined 21:16 itaipu joined, MilkmanDan joined, TEttinger joined
RabidGravy grondilu, you mean like 21:17
m: sub term:<∞> is export { Inf }; say ∞
camelia rakudo-moar 4f3f1c: OUTPUT«Inf␤»
21:18 yurivish_ joined
RabidGravy (I assume the symbol is infinity, this font is quite small) 21:19
mst it looks like it 21:21
actually it looks like a really weird set of googly eyes in a tiny face
but maybe that's just me
21:22 nige1 left
Xliff ∞) 21:23
Hmmm....
(∞)
m: sub term:<™> is export { "Trademark" }; say ™ 21:24
camelia rakudo-moar 4f3f1c: OUTPUT«Trademark␤»
Xliff Oooh....
21:27 agentzh joined
ZoffixWin m: sub term:<(╯°□°)╯┻━┻> { say "aaarrrggg" }; (╯°□°)╯┻━┻ 21:41
camelia rakudo-moar 4f3f1c: OUTPUT«aaarrrggg␤»
grondilu m: constant ∞ is export = * 21:44
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/R9b2T1em0B␤Missing initializer on constant declaration␤at /tmp/R9b2T1em0B:1␤------> 3constant7⏏5 ∞ is export = *␤»
grondilu m: constant ∞ is export = Inf
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Hcu3OpN5M_␤Missing initializer on constant declaration␤at /tmp/Hcu3OpN5M_:1␤------> 3constant7⏏5 ∞ is export = Inf␤»
grondilu ^ that was my try
21:45 itaipu left 21:46 itaipu joined
teatime I hope rakudo/perl6 resists the urge to define too many more unicode operators in core grammar 21:46
so that we can be free to use them in our own code, and you can always just use a module that imports a bunch of ops into your scope, if you want things like $perfect-squares = 1, 2², 3², …; 21:48
21:49 pyrimidi_ joined
ZoffixWin teatime, can't you do that now? 21:50
m: say 2²; sub postfix:<²> { $^a**4 }; say 2²
camelia rakudo-moar 4f3f1c: OUTPUT«4␤16␤»
teatime oh that wasn't the on I was thinking of, sorry 21:51
I was thinking of the proposal of subscript numbers meaning positional index
21:51 pyrimidine left 21:52 perigrin joined
sortiz m: say 3¹⁰⁰ # even 21:52
camelia rakudo-moar 4f3f1c: OUTPUT«515377520732011331036461129765621272702107522001␤»
teatime I would rather keep that open for subscripts that are merely part of the var name, and you can use a package if you want them to be array indexes instead.
21:53 mohae_ joined, xinming left, ocbtec left, AlexDaniel joined 21:54 ocbtec joined, awwaiid left
AlexDaniel teatime: gist.github.com/AlexDaniel/c89bd2786f9b63f31e4c 21:54
21:54 DrForr joined, awwaiid joined
teatime m: my (\A, \A₀) = 10e0, 100e0; say A / A₀ 21:54
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/SVDh4EAzyK␤Redeclaration of symbol A␤at /tmp/SVDh4EAzyK:1␤------> 3my (\A, \A7⏏5₀) = 10e0, 100e0; say A / A₀␤ expecting any of:␤ constraint␤»
21:54 BooK left
teatime m: my ($A, $A₀) = 10e0, 100e0; 21:55
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/0h_FtBVT6j␤Redeclaration of symbol $A␤at /tmp/0h_FtBVT6j:1␤------> 3my ($A, $A7⏏5₀) = 10e0, 100e0;␤ expecting any of:␤ shape declaration␤»
21:55 jercos joined, vendethiel left, woodruffw left, mohae left
teatime m: my @A = (2, 4); say @A, @A₀ 21:55
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/FcXKDYuRYU␤Bogus postfix␤at /tmp/FcXKDYuRYU:1␤------> 3my @A = (2, 4); say @A, @A7⏏5₀␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ statement end␤ …»
21:55 khagan left 21:56 itaipu left, BooK joined
teatime seems like you can't do either by default. I guess subscript numbers aren't valid identifier characters. 21:56
21:56 khagan joined 21:57 firstdayonthejob left
ZoffixWin m: '₀'.uniprop.say 21:59
camelia rakudo-moar 4f3f1c: OUTPUT«No␤»
21:59 woodruffw joined, woodruffw left
timotimo No. 21:59
ZoffixWin heh
22:00 vendethiel joined
ZoffixWin I think subscript x and y work, except for q or some one letter 22:00
22:00 woodruffw joined
ZoffixWin Ah, one subscript letter doesn't exist 22:01
AlexDaniel ZoffixWin: Yeah… because… yeah…
Xliff m: my $aₓ = 100; say $aₓ; 22:02
camelia rakudo-moar 4f3f1c: OUTPUT«100␤»
Xliff m: my @aₓ = (1, 10, 100); say @aₓ;
camelia rakudo-moar 4f3f1c: OUTPUT«[1 10 100]␤»
Xliff www.youtube.com/watch?v=gsOtVb10Qz...nson-Topic <-- I can't stop listening to this! 22:03
m: 'ₓ'.uniprop.say 22:04
camelia rakudo-moar 4f3f1c: OUTPUT«Lm␤»
AlexDaniel м
oops
Xliff m: 'ₘ'.uniprop.say
camelia rakudo-moar 4f3f1c: OUTPUT«Lm␤»
Xliff m: '₁'.uniprop.say
camelia rakudo-moar 4f3f1c: OUTPUT«No␤»
22:05 b2gills left
Xliff So why do subscript letters work but numbers don't? 22:05
AlexDaniel teatime: well, another way to do it is to allow subscripts in the names of $-sigilled variables, but for @ they could actually work like array subscripts
teatime actually it's latin lower-case super-scripts that have everything but q. the subscripts have quite a bit fewer. 22:06
AlexDaniel teatime: not sure if it makes sense. It's a bit weird
timotimo you can actually bind variables to individual slots inside an array :)
22:06 xiaomiao left, xinming joined
timotimo m: my @foo = 1, 2, 3; my $foo₀ := @foo[0]; my $foo₁ := @foo[1]; $foo₀ = 99; say @foo 22:07
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/DV4ROKZtTn␤Bogus postfix␤at /tmp/DV4ROKZtTn:1␤------> 3my @foo = 1, 2, 3; my $foo7⏏5₀ := @foo[0]; my $foo₁ := @foo[1]; $foo₀␤ expecting any of:␤ constraint␤ infix␤ …»
timotimo oh, huh?
is that so
teatime AlexDaniel: hrm, that's a thought. but yeah, I think it still overlaps with people wanting to use (the absolutely delightful and largely unavailable) math notation
22:08 xiaomiao joined
teatime I think the problem is just that currently, subscript-numbers are neither 1) defined as an operator that does index lookups, nor 2) in the set of characters specified as legal in an identifier name. 22:08
22:08 itaipu joined 22:09 ptolemarch left, pmurias left 22:11 arlenik joined 22:12 xiaomiao left, xiaomiao joined
Xliff m: sub postfix:<₀> (Array $a) { return $a[0] }; my @a = <1 2 3>; say @a₀; 22:12
camelia rakudo-moar 4f3f1c: OUTPUT«1␤»
teatime yes, realize you can define it.
Xliff I love perl6
teatime: I didn't. Hence the test. Your #2 implied that it might not work. 22:13
timotimo you may want to "is rw" that
AlexDaniel teatime: well, not really. What about ₅₆₉ ?
timotimo are there subscript roman numerals, too?
ZoffixWin Well, that's kinda useless, because you have to either have define a ton of operators (horribly slow) or restrict to a very small subset
teatime heh, you could also do postcircumfix<₍₎> for indexing. 22:14
timotimo they'd be totally useful for array subscripts
teatime you guys have totally missed my point.
ZoffixWin Same problem I had with superscript powers module
teatime, what was your point?
teatime 1) for a lot of unicode characters that you might be tempted to add to core perl grammar, there are actually several different useful things they could be used for, so probably better to not define them in core, and let people use a module to import whichever semantics they want for things like e.g. subscripts 22:15
core could add subscript numbers to legal identifier characters, and then they could be used in variable names (which is useful), but it wouldn't stop people from defining them to be array indexes if they wanted to 22:16
ZoffixWin But that's why I showed you the example with ². It's in the grammar, but you can override what it does
teatime (however, point conceeded about not being able to recognize <sub>1243</sub> as an operator) 22:17
ZoffixWin: no? 22:18
ZoffixWin: your example doesn't use ² as part of the variable name.
ZoffixWin m: say 2²; sub term:<2²> { 2**4 }; say 2² 22:19
camelia rakudo-moar 4f3f1c: OUTPUT«4␤16␤»
22:19 xinming left
Xliff Is it possible to make superscript or subscript characters useful (aside from in a small subset) with the current p6 grammar? 22:20
22:20 b2gills joined
Xliff Based on ZoffixWin's comment, I'm guessing "No." 22:20
ZoffixWin huh?
teatime Xliff: you can do this:
Xliff <ZoffixWin> Well, that's kinda useless, because you have to either have define a ton of operators (horribly slow) or restrict to a very small subset
teatime m: 2¹¹¹
camelia ( no output )
teatime m: 2¹¹¹
camelia ( no output )
ZoffixWin Xliff, that's if you're doing it with a module
teatime maybe.
ZoffixWin You can do a slang or have it in core. 22:21
m: 2¹¹¹.say
camelia rakudo-moar 4f3f1c: OUTPUT«2596148429267413814265248164610048␤»
teatime Xliff: if it's in core, it can just match an arbitrary string of sub/super digits
ZoffixWin Xliff, sorry, that's if you're doing it **by defining operators**
teatime Xliff: it's only... yeah ZoffixWin is saying the same thing
ZoffixWin It doesn't have to be in core because there are slangs
Xliff Yes, but I thought teatime's point was to not have it in core.
Now I haven't yet gotten around to slangs.
ZoffixWin (currently, without user-approved interface)
teatime it was; but my point was not really about any specific syntax. 22:22
Xliff Can someone linky?
ZoffixWin And my point was that there's no issue with having it in core
Xliff, AFAIK there aren't any docs. Slangs aren't yet ready to be used by users and may change. That's my understanding
teatime it was just a general caution, that once you put something in core you can never easily decide it should be something else, AND it will make it more difficult for people to use it for something different: even if they can easily re-define the meaning, they may no longer want to because of readability / confusion issues 22:23
ZoffixWin I've seen some examples with SQL code being directly in Perl 6 code
22:23 vendethiel left
ZoffixWin Xliff, oh, there's also DrForr's module in the ecosystem that lets you use roman numerals. That's done with slangs 22:23
teatime, I think Perl 5 is a good example of what happens when you do that. You end up importing a gazillion modules. 22:24
teatime there's a big diff. between choosing to implement $a ⋄ $b vs. $a × $b
the former is obviously something special, if you don't know what it does you'll have to look it up 22:25
ZoffixWin m: '⋄'.uniname.say
camelia rakudo-moar 4f3f1c: OUTPUT«DIAMOND OPERATOR␤»
teatime the later looks like a multiplication; if you don't know what it does, you'll naturally assume it's multiplication (incorrectly)
AlexDaniel “but it wouldn't stop people from defining them to be array indexes if they wanted to” – I don't buy it at all
teatime omfg, I quit.
bbl. 22:26
AlexDaniel because it will create too much confusion for people who read the code
ZoffixWin teatime, but you're just making an argument against your position. If most people assume × does multiplication, then it should do it, not whatever module author decided it should do
m: say 2 × 2; sub infix:<×> { $^a - $^b }; say 2 × 2;
camelia rakudo-moar 4f3f1c: OUTPUT«0␤0␤»
ZoffixWin dafuq 22:27
teatime ZoffixWin: My position is that perl should avoid putting lots of unicode into core, because anything in core is no longer (reasonably) available for use as something else.
that's exactly my entire and original point.
22:27 xinming joined
ZoffixWin But it *is* available! 22:27
22:28 Azry left
teatime it's not reasonable to re-define core operators to do something totally different. doing that is just a clever joke, not something you would want to actually use. 22:28
hence any symbols perl uses as core operators are no longer reasonably available for other purposes.
ZoffixWin m: say 2²; sub postfix:<²> { $^a**4 }; say 2² 22:29
camelia rakudo-moar 4f3f1c: OUTPUT«4␤16␤»
teatime anyway, srsly I'll brb, I appreciate the spirited debate, but I am not expressing myself well atm and it's frustrating me.
ZoffixWin m: say 2 + 2; sub infix:<+> { $^a - $^b }; say 2 + 2;
camelia rakudo-moar 4f3f1c: OUTPUT«0␤0␤»
ZoffixWin Why is postfix gets applied after I define my sub, but infix gets applied even before I define it?
22:29 RabidGravy left, Sgeo_ joined 22:31 ocbtec left
AlexDaniel ZoffixWin: ✬✭✮✯✰✴✵✶✷✸ BUG! ✸✷✶✵✴✰✯✮✭✬ 22:32
m: say [~] (0..0x1FFFF ==> grep { .uniname ~~ /STAR/ })».chr 22:33
camelia rakudo-moar 4f3f1c: OUTPUT«٭۞༌≛⋆⍟⍣␁␂★☆☪⚝✡✦✧✩✪✫✬✭✮✯✰✴✵✶✷✸✹❂⧦⭐⭑⭒𐫰🌃🌟🌠🍮🔯🝒🟀🟁🟂🟃🟄🟅🟆🟇🟈🟉🟊🟋🟌🟍🟎🟏🟐🟑🟒🟓🟔␤»
AlexDaniel I've noticed that this ↑ now works much faster
m: my $x = [~] (0..0x1FFFF ==> grep { .uniname ~~ /STAR/ })».chr; say now - BEGIN now
camelia rakudo-moar 4f3f1c: OUTPUT«2.00645850␤»
AlexDaniel star: my $x = [~] (0..0x1FFFF ==> grep { .uniname ~~ /STAR/ })».chr; say now - BEGIN now
camelia star-m 2016.01: OUTPUT«1.67602312␤»
teatime ooo, I remember the day we decided your 0x1FFFF was the perfect upper bound, but since this used to be slow:
AlexDaniel or does it
teatime m: say [~] (0..0x10FFFF ==> grep { .uniname ~~ /STAR/ })».chr 22:34
22:34 itaipu left
camelia rakudo-moar 4f3f1c: OUTPUT«٭۞༌≛⋆⍟⍣␁␂★☆☪⚝✡✦✧✩✪✫✬✭✮✯✰✴✵✶✷✸✹❂⧦⭐⭑⭒𐫰🌃🌟🌠🍮🔯🝒🟀🟁🟂🟃🟄🟅🟆🟇🟈🟉🟊🟋🟌🟍🟎🟏🟐🟑🟒🟓🟔␤» 22:34
teatime heh ok, it still takes a moment.
AlexDaniel mm and as always, this message is hidden from irclog.perlgeek.de/perl6/2016-04-14 22:35
ZoffixWin m: ''.uniprop.say 22:40
:/
.u 22:41
yoleaux U+0001 START OF HEADING [Cc] (␁)
ZoffixWin Intersting
Xliff m: say [~] (0..0x10FFFF ==> grep { .uniname ~~ /ARROW/ })».chr 22:43
camelia rakudo-moar 4f3f1c: OUTPUT«˂˃˄˅˯˰˱˲˿͍͎͔͕͖ࣹࣺ᷿͐ࣷࣸࣻࣼࣽ᪳᷾͢ ⃪⃮⃯⃔⃕⃖⃗⃡←↑→↓↔↕↖↗↘↙↚↛↜↝↞↟↠↡↢↣↤↥↦↧↨↩↪↫↬↭↮↯↰↱↲↳↴↵↶↷↸↹↺↻⇄⇅⇆⇇⇈⇉⇊⇍⇎⇏⇐…»
AlexDaniel m: ‘↯’.uniname.say 22:44
camelia rakudo-moar 4f3f1c: OUTPUT«DOWNWARDS ZIGZAG ARROW␤»
Xliff :-o
m: say [~] (0..0x10FFFF ==> grep { .uniname ~~ /APL/ })».chr
camelia rakudo-moar 4f3f1c: OUTPUT«⌶⌷⌸⌹⌺⌻⌼⌽⌾⌿⍀⍁⍂⍃⍄⍅⍆⍇⍈⍉⍊⍋⍌⍍⍎⍏⍐⍑⍒⍓⍔⍕⍖⍗⍘⍙⍚⍛⍜⍝⍞⍟⍠⍡⍢⍣⍤⍥⍦⍧⍨⍩⍪⍫⍬⍭⍮⍯⍰⍱⍲⍳⍴⍵⍶⍷⍸⍹⍺⎕𝁸𝂅𝂈𝂴𝃐𝃔𝃚𝃛🍁␤»
Xliff Oh, man! It's been decades since I've touched APL! 22:45
Xliff rubs his hands and cackles gleefully!
AlexDaniel, ‘↯’ should be called SHAZAAM! Just sayin'. 22:46
22:57 skids joined 23:00 kid51 joined 23:08 vendethiel joined
TimToady grondilu: you can't define ∞ directly as a constant because it's not alphabetic; you have to use the term:<∞> form there 23:13
ZoffixWin: you're probably running into the fact that a sub can be post-defined, along with differences in the exact timing of constant folding 23:16
23:19 ZoffixLappy joined 23:20 raoulvdberge left
TEttinger Xliff: that also has the mAPLe leaf , that I can't copy. the last char 23:20
ZoffixLappy Gotcha. Thanks. 23:21
TimToady it should probably find some way of warning that you've completely replaced a dispatcher binding 23:23
timotimo APL has an emoji?
teatime the unicode definition of emoji is kinda weird... lots of random chars here and there are marked as emoji 23:24
23:28 vendethiel left
teatime Xliff: you really don't need to search through 0x10FFFF, 0x1FFFF will cover pretty much all meaningful characters 23:30
it only excludes 2 planes of private use symbols, variation selectors, etc.
1FFFF is the BMP + the first supplemental plane
AlexDaniel teatime: and it gets even weirder when you find this: unicode.org/reports/tr51/#Emoji_ZWJ_Sequences 23:31
TimToady they're obviously prejudiced against martians 23:32
23:32 spider-mario left
TimToady groceries & 23:33
23:48 stanrifkin_ joined
Xliff 👨‍ 23:48
Oh lordy.
23:49 Herby_ joined
ZoffixLappy It's a box with hex digits! 23:49
Herby_ Evening, everyone!
ZoffixLappy :)
evening
Herby_ \o
ZoffixLappy m: '👨‍'.uninames.say
camelia rakudo-moar 4f3f1c: OUTPUT«(MAN ZERO WIDTH JOINER)␤»
ZoffixLappy wat.... a man joiner
Xliff I can actually see that.
ZoffixLappy can't
Ah. It's the ZWJ sequences. Seen 'em 23:50
sortiz timotimo, A quick question, hope you know: In which cases $*VM.config<nativecall_backend> can be ne 'dyncall' ?
timotimo when you've compiled your moarvm with --has-ffi 23:54
or --has-libffi?
travis-ci.org/MoarVM/MoarVM - check the options, sortiz
it's --has-libffi indeed
sortiz Ok, thank you. 23:55
timotimo YW 23:56
stanrifkin_ is "rakudobrew build moar" just enough to get always the latest rakudo compiler?
23:56 cdg left 23:57 cdg joined
ZoffixLappy stanrifkin_, yes 23:57
stanrifkin_ ZoffixLappy: there is 2016.03 listed - but i only got 6.c 2015.12 - what do i wrong? 23:58
timotimo there's a mechanism that we use to determine what revision of nqp and moarvm you'll have to get, and rakudobrew build moar will get you something that'll definitely work
you can get the "absolutely newest" you can "rakudobrew triple nom master master" if i recall correctly