Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2013-07-11

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:15 * timotimo tries out the threading thingies :D
00:32 diakopter .
00:32 diakopter \/\/\/\/\/\/\/\/\/
00:32 timotimo aaw, the thread pool is too small, sleep sort won't work :(
00:34 diakopter jnthn:
00:47 mtk joined #perl6
00:53 hypolin joined #perl6
00:56 hypolin joined #perl6
01:08 bonsaikitten joined #perl6
01:08 bonsaikitten joined #perl6
01:10 btyler joined #perl6
01:18 preflex joined #perl6
01:26 konundra joined #perl6
01:31 JimmyZ \o/, sorear++, jnthn++ # for promise and the future
01:53 BenGoldberg joined #perl6
01:59 [Coke] Fixed the fudging issue, i think.
01:59 dalek perl6-roast-data: 4406c92 | coke++ | bin/rakudo.sh:
01:59 dalek perl6-roast-data: use the right fudge parameter
01:59 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/4406c929e7
02:24 fridim_ joined #perl6
02:34 baest_ joined #perl6
02:37 jlaire_ joined #perl6
02:37 pjcj_ joined #perl6
02:37 szbalint_ joined #perl6
02:37 Woodi_ joined #perl6
02:37 Hor|zon_ joined #perl6
02:38 Lorn joined #perl6
02:42 bruges joined #perl6
02:46 ivan`` joined #perl6
02:49 konundra joined #perl6
02:50 djanatyn joined #perl6
02:50 fridim_ joined #perl6
02:52 takesako______ joined #perl6
03:00 sorear good * #perl6
03:00 Ben_Goldberg joined #perl6
03:01 diakopter sorear: hi
03:02 sorear hi diakopter
03:02 diakopter sorear: I started up all the things on feather3 in a screen session
03:02 BenGoldberg joined #perl6
03:39 SamuraiJack_ joined #perl6
04:26 kaleem joined #perl6
05:00 birdwindupbird joined #perl6
05:14 sorear diakopter: cool
05:14 sorear thanks
05:22 abnorman joined #perl6
05:43 domidumont joined #perl6
06:01 domidumont joined #perl6
06:06 FROGGS joined #perl6
06:06 daxim joined #perl6
06:07 FROGGS o/
06:07 sorear o/
06:16 dmol joined #perl6
06:23 FROGGS jnthn++ # demo.pl
06:26 daniel-s joined #perl6
06:26 sorear jnthn++ # pretty use of interop
06:37 domidumont joined #perl6
06:38 daxim joined #perl6
06:42 kaleem joined #perl6
06:46 odoacre joined #perl6
07:17 tadzik where's demo.pl? :)
07:28 moritz tadzik: https://gist.github.com/jnthn/5971100
07:28 moritz jnthn++ # threads!
07:31 crab2313 joined #perl6
07:31 tadzik aww, yiss :)
07:34 brrt joined #perl6
07:37 sqirrel joined #perl6
07:37 tadzik I love happy signatures. method run (Thread:D:)
07:37 tadzik (LoL:D)
07:38 tadzik std: sub foo(LoL:D)  {}
07:38 camelia std 85cf51d: OUTPUT«ok 00:00 44m␤»
07:38 moritz .oO( just for the lol:Ds )
07:41 tadzik timotimo: re sleep sort, you can declare your own $*SCHEDULER with a different max-threads, no
07:41 tadzik ?
07:42 woolfy joined #perl6
07:47 SamuraiJack__ joined #perl6
08:01 dalek Perlito: b1a510b | (Flavio S. Glock)++ | t5-bug/40-indirect-object.t:
08:01 dalek Perlito: Perlito5 - indirect-object tests
08:01 dalek Perlito: review: https://github.com/fglock/Perlito/commit/b1a510b4ea
08:12 FROGGS ohh cool
08:28 kingbeast joined #perl6
09:11 berekuk joined #perl6
09:31 jnthn morning, #perl6
09:31 jnthn Yes, you can just set $*SCHEDULER to something you prefer :)
09:31 jnthn wtf is sleepsort... :)
09:31 jnthn oh
09:31 jnthn lol!
09:32 tadzik :D
09:32 tadzik the only sort running in O(n)
09:33 dakkar joined #perl6
09:33 * moritz wonders if the scheduler is actually linear
09:34 jnthn The "scheduler" is a blocking concurrent queue
09:34 jnthn The workers try to read the next thing, and block until something is there.
09:53 gdey joined #perl6
09:56 * JimmyZ wants promise/deliver
10:01 jnthn JimmyZ: Definition of "deliver"?
10:01 * jnthn wonders which existing language/library JimmyZ is thinking of...
10:02 JimmyZ jnthn: clojure language
10:02 dalek Perlito: d0d393f | (Flavio S. Glock)++ | t5-bug/40-indirect-object.t:
10:02 dalek Perlito: Perlito5 - indirect-object tests
10:02 dalek Perlito: review: https://github.com/fglock/Perlito/commit/d0d393f999
10:02 JimmyZ deliver is really useful :P
10:03 * jnthn looks up which thing deliver is the clojure name for :)
10:03 JimmyZ and there is a 'future' too, FYI
10:05 jnthn JimmyZ: It looks like a way to create a promise that needs an argument, then supply that argument later on?
10:05 jnthn oh, no
10:05 jnthn Just a away to create one and then set its result
10:06 domidumont joined #perl6
10:07 colomon joined #perl6
10:07 jnthn Hm. Clojure's future seems rather closer to what async/Promise is doing.
10:10 jnthn The terminology is different in all the languages, it seems :P
10:18 colomon joined #perl6
10:20 mstefanko joined #perl6
10:23 colomon jnthn: https://gist.github.com/colomon/5974310  # or anyone else who might know how to make NQP work for me here.
10:23 fhelmberger joined #perl6
10:27 jnthn colomon: NQP and Rakudo have different types for things, so going by .WHAT will not work out so well
10:27 jnthn colomon: I think the best way is to have Rakudo configure sprintf with its types
10:29 colomon jnthn: … I sort of understand those words, but have absolutely no idea how to do that ...
10:29 jnthn Provide an nqp::sprintfconf(...) or something like this
10:29 jnthn That's set up in the same way sprintf is
10:31 domidumont joined #perl6
10:33 colomon a parallel sprintf command that somehow knows about rakudo, or a way of setting up normal nqp::sprintf to recognize rakudo (or whatever) types?
10:36 jnthn The latter is what I was thinking
10:36 jnthn thus the "conf"
10:37 colomon is there an example of something like that in there now that I could cargo cult?
10:38 colomon because I have no idea how to make nqp call rakudo
10:38 jnthn You don't do that!
10:38 jnthn You expose an op that *Rakudo* uses to configure sprintf.
10:38 jnthn Perhaps in BOOTSTRAP, where it has Int etc. to hand.
10:39 colomon right, I understood that.
10:40 colomon but you really need to be able to call .Int. too.
10:40 colomon err, extra period there.
10:41 jnthn If you have an object passed in from Rakudo, it'll have a .Int method that you can call, though?
10:41 colomon rn: printf("%d", 34902940294502/3)
10:41 camelia niecza v24-86-g39ab531: OUTPUT«11634313431500»
10:41 camelia ..rakudo b19f72: OUTPUT«-752973364»
10:41 colomon … well, niecza does that right.  :)
10:41 colomon rn: say 34902940294502/3
10:41 camelia rakudo b19f72, niecza v24-86-g39ab531: OUTPUT«11634313431500.666667␤»
10:41 colomon …. err, sort of right
10:42 jnthn .oO( not floorlessly... )
10:42 colomon rn: printf("%d", (34902940294502/3).num)
10:42 camelia rakudo b19f72: OUTPUT«No such method 'num' for invocant of type 'Rat'␤  in block  at /tmp/vD819q29su:1␤␤»
10:42 camelia ..niecza v24-86-g39ab531: OUTPUT«Unhandled exception: Unable to resolve method num in type Rat␤  at /tmp/7xqo_QOykx line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4579 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4580 (module-CORE @ 576) ␤  at /home/p6…
10:42 colomon rn: printf("%d", (34902940294502/3).Num)
10:42 camelia niecza v24-86-g39ab531: OUTPUT«11634313431500»
10:42 camelia ..rakudo b19f72: OUTPUT«-752973364»
10:42 colomon well, right to a first approximation
10:43 colomon anyway
10:44 colomon I'm still pretty sure I can see the shape of how to handle it if you pass in an object
10:44 colomon like
10:44 colomon 1) sprintf detects that it's a rakudo object
10:45 colomon 2) call the conf object's intify method on the object passed to sprintf
10:46 colomon 3) that method is required to return a NQP bigint
10:46 colomon 4) profit
10:46 colomon but I don't know how to actually do #1 or #2.  (I"m assuming I can easily figure out #3.)
10:46 * colomon needs to get back to the cabin to start cooking AM noms
11:10 JimmyZ jnthn: yes, I think jakudo/async is same as clojure/future, and jakudo/promise is a bit different from clojure/promise(I mean the sugar)
11:10 JimmyZ maybe I'm wrong :P
11:24 Stygia joined #perl6
12:04 lizmat joined #perl6
12:08 domidumont1 joined #perl6
12:19 kaleem joined #perl6
12:26 dalek Perlito: f04ddf9 | (Flavio S. Glock)++ | t5-bug/40-indirect-object.t:
12:26 dalek Perlito: Perlito5 - indirect-object tests; cleanup
12:26 dalek Perlito: review: https://github.com/fglock/Perlito/commit/f04ddf9b32
12:27 SmokeMachine joined #perl6
12:31 cognominal joined #perl6
12:33 btyler joined #perl6
12:40 konundra joined #perl6
12:42 notjack joined #perl6
12:54 ajr joined #perl6
12:56 notjack what's the most up-to-date site for user reference materials?  Like if I want to look up what functions are built in, log/max, etc
12:56 notjack (the perl6 web cloud is a bit, er, nebulous)
12:58 timotimo http://perlcabal.org/syn/ - this is a good point, imo
12:58 timotimo http://doc.perl6.org/ - this is also okay
12:58 moritz doc.perl6.org is mostly up to date, but incomplete
12:59 moritz doc.perl6.org is user centric, perlcabal.org/syn/ is meant as a reference to the compiler writers
12:59 notjack user-centric is what I'm looking for
12:59 notjack thanks
13:01 moritz and of course you can always ask here
13:01 moritz we try to make up for less-than-awesome documentation by being awesome in answering questsions here :-)
13:02 adu joined #perl6
13:03 notjack I'm just trying to get my head around the basics
13:03 notjack particularly the cool new stuff
13:03 notjack meta- and hyper-operators
13:04 notjack I'm focused on those in particular because I'm coming from an array-programming world, and implicit looping will make the transition to p6 much more comfortable for me
13:04 notjack so far, I can do a bunch of cool little things in isolating.  Having some trouble gluing things together syntactically.
13:04 robinsmidsrod joined #perl6
13:04 timotimo you may very well find the advent calender interesting: perl6advent.wordpress.com
13:05 timotimo it has all kinds of cool things in it :)
13:05 notjack yes, thanks I have seen that, and it's useful!
13:05 notjack here's an example of what I'd like to do.
13:05 pmurias joined #perl6
13:05 pmurias how do I add directories to nqp search path?
13:06 notjack Given a list of integers and a radix, find out the minimum number of digits in the radix R it would take to express the largest value in the list L
13:06 notjack well, the largest absolute value
13:07 moritz r: say [max] (42, -18, 8)>>.abs>>.base(16)>>.chars
13:07 camelia rakudo b19f72: OUTPUT«2␤»
13:07 moritz or
13:07 notjack the algo is something like: increment (floor ( log(radix, max(1,max-of-list(absolute-value-of-each(list))))
13:07 notjack ah, it's that .>> get gets me
13:08 notjack that always gets me
13:08 moritz r: say [max] (42, -18, 8)>>.abs>>.log(16)>>.floor
13:08 camelia rakudo b19f72: OUTPUT«1␤»
13:08 moritz I guess it should really be ceiling, not floor
13:08 moritz you can't expression 42 as a single-digit hex char
13:08 notjack no, you want the floor of the log
13:08 notjack this is calculating the # chars using logarithms, not by actual formatting each number
13:09 notjack 1+log(16,[max] 1,[max] (43,56,78)>>.abs)
13:10 notjack 1+floor log(16,[max] 1,[max] (43,56,78)>>.abs)
13:10 moritz ah, 1 + floor
13:10 timotimo >>.something is basically equivalent to .map(*.something); once you see that similarity it's easy to understand
13:11 moritz but beware, >>.something descends into recursive structures in rakudo
13:11 moritz (it's not supposed to, but it still follows an old specification)
13:11 timotimo right, that's a bit of a problematic discrepancy between the specs and implementation
13:11 notjack how do you declar a variable an array of Int - is it simply Int @array ?
13:12 moritz my Int @array;
13:12 notjack ok, let me go have a little chat with camelia
13:12 domidumont joined #perl6
13:12 notjack see if I can get past my own blinders
13:12 timotimo perl6/doc:lib/*.pod is all pod6?
13:12 pmurias --help in nqp does not include the options which are not in HLL::Compiler
13:12 ajr_ joined #perl6
13:12 moritz timotimo: yes
13:13 timotimo sweet. i'll look into a strangeness that happens at least in the classtut
13:13 notjack oh, one more
13:13 notjack how can I make a sub with a parameter that is a strictly positive Int?
13:13 timotimo perhaps it's by spec, but the code example contains empty lines inside an indented block and those get cut into multiple pieces that are then all dedented
13:14 timotimo r: sub foo(Int $a where *>=0) { say "yay" }; foo(5); foo(-5);
13:14 camelia rakudo b19f72: OUTPUT«yay␤Constraint type check failed for parameter '$a'␤  in sub foo at /tmp/HGL1B1qCDb:1␤  in block  at /tmp/HGL1B1qCDb:1␤␤»
13:15 moritz notjack: sub f(Int:D $x where $x > 0) { }
13:15 timotimo :D is a nice touch
13:15 notjack what's :D?
13:16 notjack does it mean I can reference later in the declaration by name?
13:16 timotimo no, it means "the passed argument must be defined"
13:17 timotimo r: sub f(Int:D $x) { say "yup" }; my Int $a; f($a);
13:17 camelia rakudo b19f72: OUTPUT«Parameter '$x' requires an instance, but a type object was passed␤  in sub f at /tmp/9PHIMfVEzS:1␤  in block  at /tmp/9PHIMfVEzS:1␤␤»
13:17 timotimo r: sub f(Int $x) { say "yup" }; my Int $a; f($a);
13:17 camelia rakudo b19f72: OUTPUT«yup␤»
13:17 timotimo ("instance" vs "type object" is our "defined" vs "undefined", basically)
13:18 notjack r: sub f(Int:D $x where $x>0) { say "woo";} sub g(Int $x where $x>=0) { say "yeah";} my $xx; f($xx);
13:18 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Two terms in a rowâ�¤at /tmp/B29ZYGjokM:1â�¤------> [32mub f(Int:D $x where $x>0) { say "woo";} [33mâ��[31msub g(Int $x where $x>=0) { say "yeah";}[0mâ�¤    expecting any of:â�¤        postfixâ�¤        statement endâ�¤        statement modifie…
13:18 notjack but if you hae the parameter constraint $x >= 0 anyway, doesn't that imply that $x must be defined?
13:18 notjack r: say (undef) >= 0;
13:18 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unsupported use of undef as a value; in Perl 6 please use something more specific:â�¤        Any (the "whatever" type object),â�¤      an undefined type object such as Int,â�¤  :!defined as a matcher,â�¤        Any:U as a type constraint,â�¤    Nil as the
13:18 camelia ..absence of …
13:19 notjack r: my $x; say $x >= 0;
13:19 camelia rakudo b19f72: OUTPUT«use of uninitialized value of type Any in numeric context  in block  at /tmp/VOjFGcsHtf:1␤␤True␤»
13:19 timotimo right, that only warns
13:19 JimmyZ r: sub f(Int $x where > 0) { say "yup" }; my Int $a; f($a);
13:19 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0m�Preceding context expects a term, but found infix > instead�at /tmp/3RYfPz_B5T:1�------> [32msub f(Int $x where >[33m�[31m 0) { say "yup" }; my Int $a; f($a);[0m�»
13:20 timotimo you need a * or $x there
13:20 pmurias git branch fix-help;git checkout fix-help;vim ...;git commit -a;git push won't break master?
13:20 JimmyZ r: sub f(Int $x where $x > 0) { say "yup" }; my Int $a; f($a);
13:20 camelia rakudo b19f72: OUTPUT«Parameter '' requires an instance, but a type object was passed␤  in method Bridge at src/gen/CORE.setting:3562␤  in sub infix:<>> at src/gen/CORE.setting:3490␤  in sub infix:<>> at src/gen/CORE.setting:3340␤  in sub f at /tmp/RSujJD9_FI:1␤  in block  at /tmp/RSujJ…
13:20 timotimo pmurias: if you git checkout -b fix-help, you don't need the extra git branch command
13:21 notjack r: sub f(Int:D @list, Int:D $x = 10 where $x >0) {say "So man rules! $x"}; f([1,2,3]);
13:21 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Missing blockâ�¤at /tmp/fl6GsaQZNr:1â�¤------> [32msub f(Int:D @list, Int:D $x = 10 [33mâ��[31mwhere $x >0) {say "So man rules! $x"}; f[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix stopperâ�¤        infix or meta-infixâ�¤Â»â€¦
13:21 timotimo if you want to be extra-extra sure, you can git push origin fix-help, so that master will not be touched no matter your configuration
13:21 notjack r: sub f(Int:D @list, Int:D $x = 10 where $x >0) {say "So man rules! $x";} f([1,2,3]);
13:21 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Missing blockâ�¤at /tmp/DUlcdBxB12:1â�¤------> [32msub f(Int:D @list, Int:D $x = 10 [33mâ��[31mwhere $x >0) {say "So man rules! $x";} f[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix stopperâ�¤        infix or meta-infixâ�¤Â»â€¦
13:22 bluescreen10 joined #perl6
13:23 dalek nqp/fix-help: d5989ea | (Pawel Murias)++ | src/HLL/Compiler.nqp:
13:23 dalek nqp/fix-help: Fix --help in nqp.
13:23 dalek nqp/fix-help: review: https://github.com/perl6/nqp/commit/d5989ea5ec
13:25 pmurias This shouldn't break anything, put I don't want to break rakudo once again so I'm commiting in a branch
13:26 PacoAir joined #perl6
13:27 grondilu joined #perl6
13:27 grondilu http://phys.org/news/2013-07-ordinary-language.html
13:27 notjack how can I combine constraint type checks with default values in a function declaration?
13:27 * grondilu mentioned Perl 6 here ^
13:27 notjack I can't get sub f(Int $x=10 where $x>0) {...} to work
13:28 timotimo you can do this:
13:28 notjack what I want to say is the default radix is 10 if you don't supply one, but if you do supply one, it must be strictly positive
13:28 skids joined #perl6
13:28 timotimo r: subset Radix of Int where * > 0; sub f(Radix $x=10) { say $x }; f(5); f(); f(0);
13:28 camelia rakudo b19f72: OUTPUT«5␤10␤Constraint type check failed for parameter '$x'␤  in sub f at /tmp/jR4ph2M2mI:1␤  in block  at /tmp/jR4ph2M2mI:1␤␤»
13:30 pmurias jnthn: I pushed a fix for nqp -h in a branch
13:30 notjack hmm
13:31 notjack I'd prefer not to have a proliferation of throw-away types wandering around
13:31 notjack but I guess I can add "number of digits required" as a function on the type
13:31 notjack which is kinda useful - flip the question around
13:31 timotimo what do you mean?
13:32 timotimo you can of course add a check inside the function itself, too
13:32 notjack you defined a new type, Radix, in order to enforce a constraint on a single parameter to a single function
13:32 notjack of course
13:32 timotimo i'm pretty sure subset types are very cheap
13:32 FROGGS r: sub f(Int $x where $x>0 = 10) {...}
13:32 camelia rakudo b19f72:  ( no output )
13:32 notjack but it's nicer to have it in the type signature
13:32 FROGGS r: sub f(Int $x where $x>0 = 10) { say $x }; f(-1)
13:32 notjack it's not about expense, it's about hygenie
13:32 camelia rakudo b19f72: OUTPUT«Constraint type check failed for parameter '$x'␤  in sub f at /tmp/5yTE8VvBxK:1␤  in block  at /tmp/5yTE8VvBxK:1␤␤»
13:32 kaare__ joined #perl6
13:32 timotimo oh, that's the answer?
13:33 FROGGS r: sub f(Int $x where $x>0 = 10) { say $x }; f(1)
13:33 camelia rakudo b19f72: OUTPUT«1␤»
13:33 FROGGS r: sub f(Int $x where $x>0 = 10) { say $x }; f()
13:33 camelia rakudo b19f72: OUTPUT«10␤»
13:33 FROGGS notjack: ^^
13:33 notjack ah, loverly
13:33 timotimo that was surprisingly easy >_>
13:33 notjack thank you!
13:33 FROGGS traits come first
13:33 * masak is surprised that works without a block
13:33 FROGGS (like $x is copy = 24)
13:33 ajr_ joined #perl6
13:34 timotimo i would also have thought the = would be swallowed up by the constraint
13:34 notjack the REPL in rakudo* is surprisingly effective
13:34 FROGGS bu an assignment in a trait doesnt make much sense
13:34 timotimo i've seen much better repls tbh :(
13:37 masak std: my $a; $a > 0 = 10
13:37 camelia std 85cf51d: OUTPUT«ok 00:00 43m␤»
13:39 notjack I'm used to disdaining most REPLs
13:39 notjack because the one I'm used to is awesome
13:39 notjack but R*'s is reasonable
13:39 notjack (which is why I'm surprised)
13:40 timotimo you should try using Rakudo::Debugger as a repl then; especially for regex and grammar matching ;)
13:41 notjack I'll give it a shot
13:41 notjack Nominal type check failed for parameter '@vals'; expected Positional but got Arr
13:41 notjack what does that mean?
13:41 btyler joined #perl6
13:41 timotimo can you paste some code?
13:41 moritz notjack: are you using typed arrays?
13:42 notjack sub f(Int @vals, Int:D $radix where $radix>0 = 10) { say "Radix: $radix"; }; f([1,2,3], 12);
13:42 notjack yes, an array of Int
13:42 notjack r: sub f(Int @vals, Int:D $radix where $radix>0 = 10) { say "Radix: $radix"; }; f([1,2,3], 12);
13:42 camelia rakudo b19f72: OUTPUT«Nominal type check failed for parameter '@vals'; expected Positional but got Array instead␤  in sub f at /tmp/Ypo4M24zzj:1␤  in block  at /tmp/Ypo4M24zzj:1␤␤»
13:43 masak notjack: typed arrays have to be declared.
13:43 moritz notjack: you pass in Array, but your parameter is declared as Array[Int]
13:43 masak notjack: the array literal [1,2,3] can never be of type Array of Int.
13:43 moritz the error message isn't great, admittedly
13:44 masak it sucks.
13:44 masak I'm learning about something called intrinsic types right now. intrinsic types would let [1,2,3] be an Array of Int. but the whole field is still very young and unexplored.
13:45 notjack hmm
13:45 notjack it would be inconvenient to force the users of my sub to use named arrays all the time
13:45 notjack I'll just take the Int part off
13:46 timotimo huh, i think i made a regression for Pod::To::HTML that makes X formattingcodes no longer work properly?!
13:46 notjack unless there's some kind of magic where I can say @vals>>.>0 or something
13:46 * timotimo investigates
13:46 notjack no, nevermind that
13:46 timotimo no, that would be .grep { $_ > 0 }
13:46 timotimo r: say (-5...5).grep * > 0
13:46 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0m�Preceding context expects a term, but found infix > instead�at /tmp/IhmYbRLadx:1�------> [32msay (-5...5).grep * >[33m�[31m 0[0m�»
13:46 timotimo r: say (-5...5).grep(* > 0)
13:46 camelia rakudo b19f72: OUTPUT«1 2 3 4 5␤»
13:46 notjack yeah, but it still wouldn't work if the array contained a string or something
13:47 notjack [0,1,"three"]
13:47 timotimo oh, you meant to assert that?
13:47 notjack yeah
13:47 timotimo r: say all(-5...5) > 0
13:47 camelia rakudo b19f72: OUTPUT«all(False, False, False, False, False, False, True, True, True, True, True)␤»
13:47 notjack in the function signature
13:47 timotimo r: say so all(-5...5) > 0
13:47 camelia rakudo b19f72: OUTPUT«False␤»
13:48 notjack as in sub f(@vals where all (vals) isInteger)
13:48 timotimo r: sub f(@vals where { all(@_) > 0 }) { say "happy!" }; f((1, 2, 3)); f((0, 1, 2))
13:48 moritz notjack: another complication is that arrays can be infinite (and lazy), so you can't simply check all elements at function call time
13:48 camelia rakudo b19f72: OUTPUT«happy!␤happy!␤»
13:48 timotimo oops
13:48 timotimo r: sub f(@vals where { all(@vals) > 0 }) { say "happy!" }; f((1, 2, 3)); f((0, 1, 2))
13:48 camelia rakudo b19f72: OUTPUT«happy!␤Constraint type check failed for parameter '@vals'␤  in sub f at /tmp/hRUz5Itlvb:1␤  in block  at /tmp/hRUz5Itlvb:1␤␤»
13:48 timotimo there you go
13:48 timotimo no need for the curlies any more, too
13:48 notjack so that I can have the effect of Int @vals without the declared-arrays-only drawback
13:48 notjack moritz: ah, that makes sense
13:49 notjack wait, then, if one of my parameters is a lazy list and I need to scan the whole list to return a value, when does my function return?
13:49 masak r: sub f(@vals where { all(@vals) ~~ Int }) { say "they're all Ints!" }; f [1, 2, 3, 4]
13:49 camelia rakudo b19f72: OUTPUT«Constraint type check failed for parameter '@vals'␤  in sub f at /tmp/C4EUJbZpDV:1␤  in block  at /tmp/C4EUJbZpDV:1␤␤»
13:49 notjack say I just want the [max] of the list, that's what my function does.  iif someone calls myFunc(lazyList), when does it actually return control to him?
13:50 masak hmm.
13:50 masak notjack: when the list runs out.
13:50 masak notjack: you can't know the max until the list runs out.
13:50 notjack dangerous.
13:50 masak life is dangerous.
13:50 masak programming is a subset of life. :)
13:51 masak (a strict subset, even)
13:51 notjack I'm expecting to come across "here there be dragons" in the documentation any moment
13:51 masak r: say [max] 1..*
13:51 camelia rakudo b19f72: OUTPUT«-Inf␤»
13:51 moritz wtf.
13:51 masak er.
13:51 * masak submits rakudobug
13:51 FROGGS hehe
13:51 moritz r: say [max] 1..Inf
13:51 camelia rakudo b19f72: OUTPUT«-Inf␤»
13:51 notjack r: say [max] Inf, Inf;
13:51 camelia rakudo b19f72: OUTPUT«Inf␤»
13:51 * masak .oO( so freakin' huge it's actually negative )
13:52 notjack r: say [max] Inf, -Inf;
13:52 camelia rakudo b19f72: OUTPUT«Inf␤»
13:53 masak r: say [max] 1, 5, 10, Inf
13:53 camelia rakudo b19f72: OUTPUT«Inf␤»
13:53 masak r: say [max] 42..^Inf
13:53 camelia rakudo b19f72: OUTPUT«-Inf␤»
13:53 masak r: say [max] (1..*).list
13:53 camelia rakudo b19f72: OUTPUT«-Inf␤»
13:53 FROGGS r: say 42 cmp Inf
13:54 camelia rakudo b19f72: OUTPUT«Increase␤»
13:54 timotimo aaw come on! there never was support for X<...> tags?
13:54 timotimo how did the classtut get rendered in the official version? :|
13:54 moritz with Pod::PseudoPod
13:55 timotimo is that a perl5 module?
13:55 notjack r:sub f(@vals where all(@vals) ~~ Int, Int:D $radix where $radix>0 = 10) { say "Radix: $radix"; };  f([1,2,3]);
13:56 FROGGS moritz / masak: should L75 and L84 be swapped? https://github.com/rakudo/rakudo/blob/nom/src/core/Any.pm#L84
13:56 notjack r: sub f(@vals where all(@vals) ~~ Int, Int:D $radix where $radix>0 = 10) { say "Radix: $radix"; };  f([1,2,3]);
13:56 camelia rakudo b19f72: OUTPUT«Constraint type check failed for parameter '@vals'␤  in sub f at /tmp/Vy1LF8PUwK:1␤  in block  at /tmp/Vy1LF8PUwK:1␤␤»
13:56 notjack why did the type check fail?
13:56 notjack r: 1 ~~ Int
13:56 camelia rakudo b19f72:  ( no output )
13:56 notjack r: say 1 ~~ Int
13:56 camelia rakudo b19f72: OUTPUT«True␤»
13:56 notjack r: say 2 ~~ Int
13:56 camelia rakudo b19f72: OUTPUT«True␤»
13:56 notjack r: say 3 ~~ Int
13:56 camelia rakudo b19f72: OUTPUT«True␤»
13:57 notjack r: say all([1,2,3) ~~ Int
13:57 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unable to parse expression in array composer; couldn't find final ']'â�¤at /tmp/ZbrF_Dok8D:1â�¤------> [32msay all([1,2,3[33mâ��[31m) ~~ Int[0mâ�¤    expecting any of:â�¤        postfixâ�¤        statement endâ�¤        statement modifierâ�¤     …
13:57 notjack r: say all([1,2,3]) ~~ Int
13:57 camelia rakudo b19f72: OUTPUT«False␤»
13:57 notjack WTF?
13:57 notjack r: say any([1,2,3]) ~~ Int
13:57 camelia rakudo b19f72: OUTPUT«False␤»
13:57 timotimo i know why
13:57 masak r: say all(1, 2, 3) ~~ Int
13:57 timotimo r: say any(1, 2, 3) ~~ Junction
13:57 camelia rakudo b19f72: OUTPUT«False␤»
13:57 camelia rakudo b19f72: OUTPUT«True␤»
13:58 timotimo the any thing smartmatches as a junction
13:58 timotimo it does not autothread
13:58 masak right.
13:58 masak r: say (1, 2, 3) >>~~>> Int
13:58 camelia rakudo b19f72: OUTPUT«True True True␤»
13:58 masak r: say all (1, 2, 3) >>~~>> Int
13:58 timotimo that's better
13:58 camelia rakudo b19f72: OUTPUT«all(True, True, True)␤»
13:58 masak r: say so all (1, 2, 3) >>~~>> Int
13:58 camelia rakudo b19f72: OUTPUT«True␤»
13:59 notjack "so"?
13:59 masak opposite of "not".
13:59 timotimo so, the synopsis on pod6 says that X<class> is supposed to be rendered as "class" and add an index entry; mind if i replace all the X<stuff> in the classtut with X<|stuff>, so that they get zero-width-rendered and implement that in Pod::To::HTML?
14:00 masak timotimo: sounds good.
14:00 timotimo (not only the classtut, though)
14:00 FROGGS notjack: it is the low precedence form of prefix ?, like 'not' is for !
14:00 * timotimo is still a bit bitter about how hard it seems to make formattingcodes work in tables and code blocks
14:00 FROGGS r: say ?0
14:00 camelia rakudo b19f72: OUTPUT«False␤»
14:01 rindolf joined #perl6
14:01 notjack I just like that you got the right answer because of your "say so"
14:01 moritz http://faq.perl6.org/#so
14:01 timotimo heh :D
14:02 timotimo Error executing process: Cannot allocate memory - o_O
14:02 timotimo when trying to create the typegraph
14:02 moritz :/
14:03 timotimo well, it's not that important; i just want to fix the markup for now
14:04 masak hm... I'd like to extend that FAQ with a sentence saying that "so" is the opposite of "not". it's a nice donkey bridge which deserves to be in there.
14:05 * masak finds the source
14:05 timotimo "is not!" - "is so!"
14:05 notjack where would I look in the docs to learn about function signature syntax/
14:05 moritz http://doc.perl6.org/type/Signature#Signature+Literals
14:05 notjack thanks!
14:06 timotimo hm, would a X<foo|bar> be properly rendered as foo<a name="bar">?
14:07 dalek faq: d725657 | (Carl Mäsak)++ | answers.md:
14:07 dalek faq: [answers.md] 'so' is the opposite of 'not'
14:07 dalek faq: review: https://github.com/perl6/faq/commit/d72565741c
14:08 timotimo htmlify.pl goes up to 5gb ram usage here
14:08 timotimo that can't be right, can it?
14:09 masak timotimo: you still need to close <a name="..."> elements.
14:09 timotimo oh, of course, so <a name="..."/>
14:09 masak no no no
14:09 timotimo ...no?
14:09 masak it's likely HTML 4.01, not XHTML
14:09 timotimo that's fair
14:09 masak <a name="bar">foo</a>
14:09 timotimo actually:
14:09 timotimo <!doctype html>
14:09 masak then still not :)
14:10 timotimo that's for something very specific, isn't it?
14:10 masak hold on, I'll get you the appropriate SO answer :)
14:10 masak timotimo: it's for HTML5.
14:10 moritz <span id="bar>foo</span> ?
14:10 timotimo oke. and html5 doesn't have /> any more?
14:10 masak timotimo: read the topmost answer to http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5
14:11 timotimo great, thanks!
14:11 masak tl;dr: <a name="bar" /> is syntactic HTML5, but the '/' *does not mean self-closing tag*.
14:11 masak it doesn't and it never did in any version of (non-X) HTML.
14:12 timotimo thanks for clearing that up!
14:12 timotimo i think i've been doing that wrong for some time now
14:12 masak no problem :)
14:12 timotimo meanwhile, the htmlify.pl process has reached 6.6gb of ram
14:12 * masak is currently authoring a 3-day HTML5 course for $dayjob
14:12 timotimo i'm pretty sure it's keeping something around that it really shouldn't
14:13 moritz it never took 6gb on my machine
14:14 moritz (since the machines I ran it on typically only had 4gb ram :-)
14:15 timotimo luckily, i also have 10gb of swap space available!
14:17 timotimo hm, well, definition registry seems to keep around a whole lot of pod ...
14:18 moritz but not *that* much
14:18 timotimo (7.4gb of ram used)
14:18 moritz are you using rakudo-jvm?
14:18 timotimo no, this is parrot
14:18 timotimo i'm not even sure i could run htmlify on rakudo-jvm
14:18 masak moritz: re 'span id', yes, that's how I'd do it, methinks.
14:18 timotimo masak: didn't realize you could use spans as link targets like that. cool.
14:18 masak moritz: somewhere along the way I got the impression that id attributes are preferred to 'a name' anchors.
14:19 Stygia joined #perl6
14:19 masak timotimo: with the exception of a very small set of elements (like <title>), *all* HTML elements accept an 'id' attribute.
14:19 timotimo they accept an id attribute of course, but i didn't realize all of them would work like link targets
14:20 timotimo i thought that was what <a id...> was for
14:20 timotimo er, actually i thought you used <a name=...> for that
14:20 masak you do.
14:20 masak I think <a name="..."></a> is the older mechanism and 'id' attributes the newer one.
14:21 masak they have slightly different semantics because the <a>...</a> wraps around something, whereas the 'id' sits directly on an element.
14:21 timotimo html changes so fast ...
14:21 masak yes, but this is an old change :)
14:22 timotimo yeah. i haven't been keeping up ;)
14:22 timotimo aaw, i wasn't there to see how much ram the process was taking up when it got to trying to create the graphviz file
14:23 masak oh, in HTML5 the <a name> construct is invalid.
14:23 masak I didn't know that.
14:23 domidumont joined #perl6
14:23 masak at least according to http://stackoverflow.com/questions/484719/html-anchors-with-name-or-id -- but that comment is from 2009.
14:26 stevan_ joined #perl6
14:26 timotimo pod::to::html complains *very* often about being asked to dedent 8, but the shortest indent being 0 while creating the definition reference parts at the end; i wonder what that's all about
14:27 moritz interpolating a variable into a heredoc
14:27 timotimo is it something i should try to fix?
14:29 moritz yes
14:30 moritz (it's a bit non-trivial)
14:30 timotimo mhm :|
14:30 timotimo first i'll make sure that output pod blocks are parsed preformatted..ly
14:31 timotimo but that probably requires changes in rakudo itself
14:32 masak yes, that should be fixed.
14:32 masak there's an RT ticket about that.
14:33 masak https://rt.perl.org/rt3/Ticket/Display.html?id=117603
14:35 stevan_ joined #perl6
14:36 timotimo i'm not thoroughly sure how to understand that. is that only for interpolations that only have spaces to the left of them? if there's more spaces than the 'virtual left margin' will all the new lines of that interpolation be indented as well?
14:36 masak (I've always liked that discussion. it's such a clear example of tormenting the developer to benefit the end user.)
14:36 notjack multi ndr(@vals where so all(@vals) >>~~>> Int, Int:D $radix where $radix>0=10) {1+floor log((1 max [max] @vals>>.abs), $radix)}; multi ndr(Int:D $val, Int:D $radix where $radix>0=10) {ndr([$val], $radix)}; say ndr(257,16);
14:36 timotimo so if the line reads foo {bar} baz, surely there should be no denting of the in or out kind
14:37 timotimo if the line reads "    {foo}" and foo evaluates to something with newlines in them, it should indent the following lines to match with the left curly?
14:37 notjack in the above, I would like to modify the scalar version of the multi such that if it's not supplied a $radix, it calls the one-parameter vetrsion of the array-flavored multi
14:37 masak timotimo: the termintor sets the indent level. everything's de-indented based on that. but it's *textual*, so the contents of interpolated variables shouldn't be de-indented.
14:37 masak timotimo: only the text in the source code should be de-indented; I guess that's the short answer.
14:37 notjack (i.e. let the "primary" flavor determine all defaults, rather than repeat them)
14:38 timotimo oh
14:38 masak notjack: you don't need the 'so' if you're in a where clause. the where clause is only interested in the boolean value anyway.
14:38 timotimo interesting. so basically "de-dent the code before any interpolation happens" should be the right way to do it, no?
14:38 masak timotimo: right.
14:38 timotimo why isn't that easy? :)
14:38 masak timotimo: which (as jnthn suggests) means you have to de-indent at the AST level.
14:38 masak which means*
14:38 masak er, no. un-fix that typo :)
14:39 notjack masak: I thought the "so" coalesced the [true,true,true] to true in this case
14:39 timotimo so, it would happen in an action method?
14:39 timotimo notjack: that's what "all" does
14:39 timotimo er, no
14:39 timotimo so all(true, true, true) will be turned into true
14:39 notjack got it
14:39 masak notjack: 'where' will collapse the junction for you; no need for 'so'
14:39 timotimo so [true, true, true, true] will *also* be turned into true, but that's because a list of things is true
14:40 timotimo r: say so [False, False, False]
14:40 camelia rakudo b19f72: OUTPUT«True␤»
14:40 masak notjack: your example is a bit too long for me to take it in easily. :/
14:40 masak notjack: maybe if you had a shorter toy example, I could be of assistance.
14:41 notjack sure
14:43 notjack multi f(@arry, $x='default') {...}; multi f($scalar, $x='default') {f([$scalar],$x);} say f(12);
14:43 notjack what I would like is to not repeat the $x='default' bit, while still allowing the scalar version of the multi to be called with the $x parameter
14:44 masak hm.
14:44 notjack I don't want to have ot keep the defaults of the two flavors in sync
14:44 notjack if you see what I mean - I want the "primary" definition to control defaults
14:44 masak define a constant.
14:44 masak use it instead of the string 'default' in both places.
14:44 masak r: constant x_default = 'default'; say x_default
14:44 camelia rakudo b19f72: OUTPUT«default␤»
14:45 notjack Can I ask "hey, was $x actually passed in by the user this time, or defaulted?"
14:46 moritz no
14:46 PerlJam notjack: why?
14:46 timotimo what, there are no tests for heredocs? have i gone mad?
14:47 notjack because notationally, I'd like to have one primary method signature, and all other polymorphic variations just deal with deviations from that primary signature
14:47 moritz timotimo: S02-literals/quoting.t has some
14:47 timotimo notjack: in that case, you may want to create a proto that does its own dispatching
14:47 timotimo (dispatch with "nextsame" in that case)
14:47 notjack multi f(big fancy signature); multi f("hey, I'm the same as the fancy f, except my first param is a scalar, not an array")
14:48 timotimo why didn't my code search tool find the test? probably skips .t by default or something crazy like that?
14:48 notjack ctrl+f proto didn't find anything in doc.perl6.org
14:49 moritz timotimo: git grep ':to\b' # worked for me
14:49 timotimo i'm using ag, so i should probably stop doing that
14:50 PerlJam timotimo: You should be using ack  :)
14:51 notjack wow, there's a lot of coolness in here too
14:51 notjack including a literal 'cool'
14:51 notjack found a reference to 'proto' under 'multiness'
14:53 timotimo mind if i rip out the heredoc tests from S02-literals/quoting.t and put them into S02-literals/heredocs.t and add a bunch of tests
14:53 timotimo ?
14:53 cognominal joined #perl6
14:54 moritz please do
14:55 notjack ah, S06
14:55 masak interesting on the philosophy of 'for' loops: http://lwn.net/Articles/557073/
14:58 timotimo i'm getting two strange failures in S02-literals/quoting.t; is @two_lines, ("$hello\n", "world\n") turns out to "expect" 'howdy\n world\n"; does that " " before world come from the is function turning the list into a string separated by a space?
14:58 timotimo and if so, why do i get that failure, but it's not in roast-data?
15:00 moritz yes, is() compares by string
15:00 moritz and is the test TODOed, maybe?
15:00 moritz or TODO-fudged
15:00 timotimo oh!
15:01 timotimo yes, but it doesn't get fudged correctly. i must be missing the rakudo.parrot fudge operator fix
15:02 timotimo ah! i need to re-run Configure.pl to get that
15:04 [Coke] that was from a while ago, no?
15:04 [Coke] (I just fixed my daily test runs, but those use test_summary, which is special.)
15:04 timotimo yes, it was
15:05 timotimo as said, configure.pl needs to be re-run to get the change into t/fudgeandrun
15:07 mathw_ masak: very interesting article
15:10 timotimo if i interpolate "Hello\n    World" into a heredoc, the four spaces before the World should be verbatim in the result, is that correct?
15:13 JimmyZ yes, I think
15:13 timotimo good
15:15 timotimo i see now why it's hairy :D
15:15 timotimo but i think i can make it work. i think i'll take a bit of relax-and-inspiration time on the balcony :3
15:18 masak timotimo++
15:19 timotimo (the moment i wrote that, a big cloud moved in front of the sun :(  )
15:19 masak JimmyZ is correct. de-indent things from interpolated variables is exactly what a by-spec heredoc *shouldn't* do (and what Rakudo currently does).
15:20 mathw r: my $a = 3; if $a == 3|4 { say "wibble"; }
15:20 camelia rakudo b19f72: OUTPUT«wibble␤»
15:21 stevan__ joined #perl6
15:21 timotimo should be a case of just splitting up the infix:<~> calls, checking which parts of them come after a newline and dedenting these constants by the $amount
15:21 cognominal can someone makes sense of the problem showed by that gist?   https://gist.github.com/cognominal/5976412
15:22 cognominal "calling .parse in a TOP action causes problems"
15:31 cognominal will be back within 6 hours and reading the backlog about my gist.
15:31 masak cognominal: my guess: calling .parse in an action method resets $/
15:31 notjack I'm starting to wrap my head around proto, but I still can't see how to use it to abstract out repeated paramters
15:31 notjack without actually declaring those parameters in each multi
15:32 cognominal masak: that would be why the indirect call does not cauuse problem
15:32 sjohnson joined #perl6
15:33 cognominal I think that would explain also my other problems not shown in my gist.
15:33 cognominal thx masak
15:34 notjack ... but now I see that while I have to declare the params, I can keep the param _constraints_ just n the proto
15:34 notjack which is nice
15:39 bluescreen10 joined #perl6
15:41 cognominal masak: that does not seem to be the (only) problem. Wrapping the inner parse in a  do {}   to protect $/ does not help.
15:41 notjack ok, so if | means "flatten into an argument list", it can also flatten slurpy params
15:41 notjack but positional params have to come before slurpy
15:42 notjack so how can I define a signature that says "any positional parameters at all, followed by a positional parameter named $a, followed by any other parameters (named, optional, slurpy, whatever)"
15:42 notjack ?
15:42 notjack basically I want to declare a proto that manages multis whos name is ndr and whose final positional parameter is $radix
15:42 cognominal afk&
15:43 masak why would a 'do {}' protect $/ ?
15:44 cognominal because it introduces a scope and a new $/
15:45 masak today's autopun spotting: https://twitter.com/SnoozeInBrief/status/355258745279881216
15:45 [Coke] r: my $/ = "hi"; do { say $/};
15:45 camelia rakudo b19f72: OUTPUT«Potential difficulties:â�¤    Redeclaration of symbol $/â�¤    at /tmp/dTjbuNEwxx:1â�¤    ------> [32mmy $/ [33mâ��[31m= "hi"; do { say $/};[0mâ�¤hiâ�¤Â»
15:45 [Coke] r: $/ = "hi"; do { say $/};
15:45 camelia rakudo b19f72: OUTPUT«hi␤»
15:47 grondilu joined #perl6
15:47 masak r: $/ = "1"; do { $/ = "2" }; say $/
15:47 camelia rakudo b19f72: OUTPUT«2␤»
15:48 grondilu r: $_ = "01"; tr/01/10/; .say
15:48 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Bogus statementâ�¤at /tmp/VWigbsdbc9:1â�¤------> [32m$_ = "01"; tr/01/10/[33mâ��[31m; .say[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix stopperâ�¤        infix or meta-infixâ�¤        prefix or termâ�¤        prefix or meta-prefixâ�¤O…
15:48 grondilu n: $_ = "01"; tr/01/10/; .say
15:48 camelia niecza v24-86-g39ab531: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Action method quote:tr not yet implemented at /tmp/v_ddSFZH3B line 1:â�¤------> [32m$_ = "01"; tr/01/10/[33mâ��[31m; .say[0mâ�¤â�¤Unhandled exception: Unable to resolve method statement_level in type Anyâ�¤  at /home/p6eval/niecza…
15:49 timotimo enh, if infix:<~> were list precedence, the trim heredoc part would be so much simpler :|
15:49 grondilu n: $_ = "01"; .=trans(01 => '10'); .say
15:49 notjack I'm almost there
15:49 camelia niecza v24-86-g39ab531: OUTPUT«Potential difficulties:â�¤  Leading 0 does not indicate octal in Perl 6; please use 0o1 if you mean that at /tmp/J5zc36ujUj line 1:â�¤------> [32m$_ = "01"; .=trans(01[33mâ��[31m => '10'); .say[0mâ�¤â�¤01â�¤Â»
15:49 grondilu rn: $_ = "01"; .=trans('01' => '10'); .say
15:49 camelia rakudo b19f72, niecza v24-86-g39ab531: OUTPUT«10␤»
15:49 timotimo wow, whoops. that shouldn't happen, right?
15:50 cognominal r:  my $a = 1; do { my $a = 2 }; say $a;
15:50 camelia rakudo b19f72: OUTPUT«1␤»
15:50 notjack r: proto ndr(Any, Int:D $r where $r>0 = 10) {*}; multi ndr(@vals, $r){...}; multi($val,$r){ndr [$val],$r}; ndr(234,5);  #works, and constraint on $r is carried through
15:50 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Variable '$val' is not declaredâ�¤at /tmp/oXoySRBHpz:1â�¤------> [32m}; multi ndr(@vals, $r){...}; multi($val[33mâ��[31m,$r){ndr [$val],$r}; ndr(234,5);  #works[0mâ�¤    expecting any of:â�¤        postfixâ�¤Â»
15:50 cognominal really afk now &
15:51 notjack now, how can I allow for any number of positional parameters preceding $r (such that $r is always the last positional paramters)
15:52 masak timotimo: S03 says infix:<~> is list associative.
15:52 masak X  Concatenation     ~
15:52 masak X   list      infix:<!>($a; $b; $c)
15:52 notjack does silence mean that "that's not possible"?
15:53 masak notjack: no, that's not how IRC works. :)
15:54 notjack I find it does, usually ;)
15:54 masak notjack: but yes, that's not possible.
15:54 masak variadic parameters must come after positional parameters.
15:54 masak (otherwise parameter matching would have to do backtracking)
15:54 notjack that makes sense - I guess what I'm looking for is a trick like | that just means "the positional parameters"
15:55 notjack and a corresponding trick that means "just the variadic parameters"
15:55 FROGGS joined #perl6
15:55 notjack so I could do  proto foo(<all positional parameters, Int $r, <all variadic parameters>(
15:55 notjack essentially, enforce constraints at the end of the positional parameters
15:56 [Coke] why do you need a proto for this?
15:56 [Coke] (multiple multis is insufficient?)
15:57 notjack someone suggested earlier that that's the best way to maintain parameter constraints for all multis in a single, central place
15:57 notjack this is what I have now:
15:57 TimToady I believe a capture will distinguish @ elements from % elements
15:57 yoleaux 10 Jul 2013 18:18Z <diakopter> TimToady: Uni? plz?
15:57 timotimo masak: yes, it is list associative. but not in rakudo ;)
15:57 timotimo but my new plan will be invariant under wether infix:<~> is list or whatever associative
15:58 masak :)
15:59 benabik joined #perl6
15:59 notjack Here's where I am now, and what I'm trying to get to  http://pastebin.com/A6T02qpb
16:01 diakopter notjack: I think a slurpy has to be the last thing only
16:01 notjack diakopter: that makes sense - I'm not worried about slurpies.
16:02 notjack diakopter: what I want is a proto that will govern any multis which match the signature where Int $radix is the last _positional_ parameter
16:02 diakopter I know; I understod. :) a slurpy is what you'd have to use to get a variable number of args
16:03 TimToady well, protos usually are written in terms of captures, not slurpies
16:03 TimToady and I repeat: I believe a capture will distinguish @ elements from % elements
16:03 diakopter how would that look?
16:04 TimToady so your proto could introspect the @ part
16:05 TimToady sub foo(|c) { say +@(c) }; foo <a b c>, :y, :z
16:05 TimToady nr: sub foo(|c) { say +@(c) }; foo <a b c>, :y, :z
16:05 camelia rakudo b19f72, niecza v24-86-g39ab531: OUTPUT«1␤»
16:05 TimToady hmm
16:06 TimToady nr: sub foo(|c) { say +@(c) }; foo 1,2,3, :y, :z
16:06 camelia rakudo b19f72, niecza v24-86-g39ab531: OUTPUT«3␤»
16:06 diakopter nr: sub foo(|c) { say +@(c) }; foo |<a b c>, :y, :z
16:06 camelia rakudo b19f72, niecza v24-86-g39ab531: OUTPUT«3␤»
16:07 TimToady nr: sub foo(|c) { say +%(c) }; foo 1,2,3, :y, :z
16:07 camelia rakudo b19f72, niecza v24-86-g39ab531: OUTPUT«2␤»
16:07 Stygia joined #perl6
16:07 notjack TimToady: the goal is to enforce certain constraints on a specific [set of trailing] positional parameters
16:07 notjack so I can't use |, or at least I don't think I can
16:08 diakopter why does the Int need to be trailing
16:08 TimToady a proto can enforce anything it likes before dispatching to the multis
16:08 TimToady it doesn't all have to be in the signature
16:09 TimToady that's why we have a notation for "put the dispatcher here"
16:10 diakopter notjack: can you put the radix at the beginning?
16:10 TimToady nr: sub foo(|c where c[*-1] > 0) { say "here" }; foo 1,2,3, :y, :z
16:10 camelia niecza v24-86-g39ab531: OUTPUT«Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object␤  at Builtins.InvokeSub (Niecza.P6any obj, Niecza.Variable[] pos) [0x00000] in <filename unknown>:0 ␤  at Niecza.Kernel.ToComposable (Niecza.STable arg…
16:11 camelia ..rakudo b19f72: OUTPUT«here␤»
16:11 TimToady r: sub foo(|c where c[*-1] > 0) { say "here" }; foo 1,2,-3, :y, :z
16:11 camelia rakudo b19f72: OUTPUT«Constraint type check failed for parameter 'c'␤  in sub foo at /tmp/W1YzpTosRe:1␤  in block  at /tmp/W1YzpTosRe:1␤␤»
16:13 notjack diakopter: the idea is that these are the optional parameters
16:14 notjack diakopter: the "knobs" the caller doesn't have to worry about unless he wants to
16:14 notjack diakopter: as opposed to the primary arguments, which should come first
16:14 moritz then it might be a good idea to make them named
16:14 moritz then they stand out more from the normal arguments
16:15 notjack TimToady: that won't work, because might be length 1
16:15 diakopter moritz: I agree; named is better
16:15 moritz histogram(1, 2, 3, 4, 42, 2, 0.1) vs. histogram(1, 2, 3, 4, 42, 2, resolution => 0.1)
16:15 notjack hmm
16:16 notjack it still leaves the same problem though
16:16 notjack no?
16:16 diakopter you can provide a default value for nameds
16:16 notjack would you mind showing me?
16:17 notjack http://pastebin.com/A6T02qpb
16:17 notjack that's what I have now - how would you change it so the name param, and its constraints, are declared once in the proto
16:17 diakopter I don't understand the >0 constraint
16:17 notjack the radix must be positive
16:17 notjack (for my purposes)
16:17 diakopter (what do you want it to do when the last thing is <=0)
16:17 notjack I want it to fail
16:18 notjack or, not find a matching sub
16:21 notjack (Today has been a great p6 clinic btw - thanks to everybody)
16:22 diakopter n: https://gist.github.com/diakopter/5976904
16:22 camelia niecza v24-86-g39ab531: OUTPUT«3␤»
16:22 TimToady r: proto foo(|c) { die "Radix must be positive" unless c[*-1] > 0; {*} }; multi foo(|c) { c.perl.say }; foo 1,2,3; foo 4
16:22 camelia rakudo b19f72: OUTPUT«Capture.new( list => (1, 2, 3).list, hash => EnumMap.new())␤Capture.new( list => (4,).list, hash => EnumMap.new())␤»
16:22 TimToady r: proto foo(|c) { die "Radix must be positive" unless c[*-1] > 0; {*} }; multi foo(|c) { c.perl.say }; foo 1,2,-3; foo 4
16:22 camelia rakudo b19f72: OUTPUT«Radix must be positive␤  in sub foo at /tmp/cTePnxHDpx:1␤  in block  at /tmp/cTePnxHDpx:1␤␤»
16:22 diakopter hey yours is too similar to mine :P
16:23 TimToady that's what I was saying, you can write an entire program of validation inside the proto, then dispatch
16:23 TimToady you can be as specific as you like in the error messages
16:23 diakopter notjack: (see, you can pass a gist url to camelia)
16:23 notjack diakopter: thanks
16:24 notjack re your gist, yes, I get that I can put conditionals int he bodies of functions
16:24 diakopter n: https://gist.github.com/diakopter/5976904/e4b702d8690dc271d00222dc096606d4926c3092
16:24 camelia niecza v24-86-g39ab531: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Confused at /tmp/wj99mtRRET line 1:â�¤------> [32mhttps[33mâ��[31m://gist.github.com/diakopter/5976904/e4b[0mâ�¤â�¤Undeclared routine:â�¤      'https' used at line 1â�¤â�¤Parse failedâ�¤â�¤Â»
16:24 notjack today, I'm exporing the new ideas in P6
16:24 notjack particularly around validation and parameters
16:24 TimToady notjack: did you see what I did above in the proto?
16:25 notjack TimToady: similar comment
16:25 notjack TimToady: I want to have the notation declare my intent
16:26 TimToady where is simply a conditional, even if it looks declarational, so there's really no difference
16:26 notjack there is to the reader
16:26 notjack (that's why you guys put it in1)
16:26 TimToady all it does is guarantee you get a worse error message :)
16:27 notjack s/1/!/
16:27 notjack TimToady: code like c[-1] is brittle and opaque
16:28 TimToady r: proto foo(|c where (c[*-1] > 0 || die "Radix must be positive")) {*}; multi foo(|c) { c.perl.say }; foo 1,2,-3; foo 4
16:28 camelia rakudo b19f72: OUTPUT«Radix must be positive␤  in sub foo at /tmp/nKW4TCEY2O:1␤  in block  at /tmp/nKW4TCEY2O:1␤␤»
16:28 notjack TimToady: and hard to understand from the caller's perspective, if he can even see it
16:28 TimToady c[*-1] is how you write "the last element of c"
16:28 notjack Int $radix where $radix>0 = 10 says "the last parameter is a radix, it must be positive, it's optional, and if not supplied, defaults to 10"
16:29 TimToady how could it be simpler?
16:29 notjack TimToady: it's not "simpler" it's "clearer"
16:30 notjack an radix-the-positive-integer-whose-default-is-10
16:30 TimToady I don't think backtracking in signatures is clearer
16:30 flussence rn: say (454/1000) ** -1
16:30 camelia rakudo b19f72: OUTPUT«Nominal type check failed for parameter 'nu'; expected Int but got Num instead␤  in sub DIVIDE_NUMBERS at src/gen/CORE.setting:8447␤  in sub infix:<**> at src/gen/CORE.setting:8588␤  in sub infix:<**> at src/gen/CORE.setting:3315␤  in block  at /tmp/bnIcZcjX89:1␤␤»…
16:30 camelia ..niecza v24-86-g39ab531: OUTPUT«2.202643␤»
16:30 notjack let's say we can live with c[*-1]; how do you default it to 10?
16:31 notjack (which, before you came in, was the motivation behidn using a proto)
16:31 vk joined #perl6
16:32 TimToady it would take backtracking in signature to allow that in a proto
16:33 TimToady *tures
16:33 notjack do protos dispatch based on parameter _name_ matches, or just types?
16:34 BooK joined #perl6
16:34 TimToady that would depend on whether you're doing named parameters or not
16:34 diakopter well, found a rakudo parser/grammar error
16:34 notjack sorry, I meant of positional parameters
16:35 TimToady it was once specced that we allow binding of named args to positional parameters, but the implementors rebelled :)
16:36 timotimo what's so bad about a named for the radix, though? maybe make it short, like :r(10)?
16:37 stevan_ joined #perl6
16:37 benabik Can't you specify more than one name, so you can have a short :r and long :radix?
16:37 notjack I don't mind using a named radix
16:37 notjack what I want is to enforce the constraint centrally
16:37 diakopter benabik: ahahahaha  parameter names as regexes! yes! :D
16:37 notjack so that the 10 (or moral equivalent) is only mewntioned once in the file
16:38 timotimo you can do the defaulting in the proto and pass it on as it is to the multis
16:38 rafl joined #perl6
16:38 timotimo the multis don't have to have the default value in them because the proto will always turn it into a value, given or not
16:38 timotimo (that is my intuition)
16:39 notjack if I could change the $scalar version of $ndr to say "pass all my parameters to the @array version of ndr, except pass [$var] as the @var parameter of that version", I'd be all set
16:39 TimToady there's something smelly about treating the positionals as variadic and then adding in a radix at the same level
16:39 TimToady it's really bad api design
16:39 notjack timotimo: that's correct - that's what I'm doing now - but it also puts other, undersirable, constraints on the form of the multis
16:40 timotimo ah
16:40 timotimo if you have a proto, the form fo the multis is not important; you can do the dispatching yourself if you don't use {*}
16:40 notjack timotimo: in particular, given the grammer of function signatures, I can't have a proto that says "an unlimited number of positional paramters, followed by one named radix witha d efauilt value of 10"
16:40 notjack timotimo: yes, but the idea here is to take advantage of the notation
16:40 timotimo mhm
16:41 benabik r: sub foo(:b(:$bar)) { say $bar }; foo b => 1
16:41 camelia rakudo b19f72: OUTPUT«1␤»
16:41 timotimo can't you destructuring-bind that? i forgot the syntax though because i hardly ever use it
16:41 grondilu joined #perl6
16:41 notjack I don't really know.  This is the first time I've really spent any time with p6
16:41 grondilu How do I test set inclusion?
16:42 timotimo er, wait, why *can't* you have "an unlimited number of positionals followed by one named radix with a default of 10"?
16:42 notjack I'm trying to learn it (which is the real point of this whole exercise)
16:42 * TimToady thinks the use case for a final weird positional argument is rather weak
16:42 notjack try it
16:42 notjack TimToady: I'm happy to have it named, too
16:42 notjack TimToady: I think foo(blah, blah, blah, radix=>16) is pretty cool
16:42 diakopter notjack: I'm confused.. when you're having it be a Positional, when would it ever be the default of 10?  (how could it be optional)
16:42 TimToady named works fine, and doesn't violate the parallelism of the n-1 positional args
16:42 notjack TimToady: but again, I'd like both the constraints on that parameter, and its default, specifired once
16:43 timotimo r: proto sub frob(*@args, :$radix=10) { say "i have { +@args } args and here's my $radix" }; frob(1, 2, 3, :radix(99)); frob(1, 2)
16:43 camelia rakudo b19f72: OUTPUT«i have 3 args and here's my 99␤i have 2 args and here's my 10␤»
16:43 timotimo there you go
16:43 notjack diakopter: what it's the last, and omitted
16:43 diakopter but how do you know if it's omitted?
16:43 timotimo i think notjack is confusing named and positionals in some way, shape or form
16:43 notjack f(hi, stuff, there, 13) vs f(hi, stuff, there)
16:43 notjack timotimo: entirely possible
16:44 diakopter notjack: but how can you tell that "there" isn't the radix?
16:44 timotimo indeed, that's the basic problem
16:44 notjack because I have multis that declare (Sr hi, Int stuff, Str there, Int radix)
16:44 timotimo ah, okay, that's different
16:44 notjack all my multis end in "Int radix)
16:44 timotimo in that case you may want something like:
16:44 diakopter in that case, "there" is a Str
16:44 diakopter so it can be differentiated
16:45 diakopter but if it's the same type, it can't
16:45 notjack diakopter: there are no multis missing radix
16:47 * TimToady thinks about subset types with defaults...
16:47 timotimo r: proto sub do-it(*@foo) { my $radix = 10; if @foo[*-1] ~~ Int { $radix = foo.pop } nextwith(*@foo, :$radix) }; multi do-it(Str $a, Str $b, :$radix) { ... }; multi do-it(Str $a, :$radix) { ... };
16:47 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Confusedâ�¤at /tmp/UsbcD2XGvy:1â�¤------> [32mf @foo[*-1] ~~ Int { $radix = foo.pop } [33mâ��[31mnextwith(*@foo, :$radix) }; multi do-it([0mâ�¤    expecting any of:â�¤        method argumentsâ�¤        postfixâ�¤        statement endâ�¤        st…
16:48 timotimo r: proto sub do-it(*@foo) { my $radix = 10; if @foo[*-1] ~~ Int { $radix = foo.pop }; nextwith(*@foo, :$radix) }; multi do-it(Str $a, Str $b, :$radix) { say "two strigns" }; multi do-it(Str $a, :$radix) { say "one string" }; do-it("foo", "bar", 90); do-it("foo", "bar"); do-it("foo", 1000);
16:48 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unable to parse expression in argument list; couldn't find final ')'â�¤at /tmp/DaC9DtlOwk:1â�¤------> [32m ~~ Int { $radix = foo.pop }; nextwith(*[33mâ��[31m@foo, :$radix) }; multi do-it(Str $a, St[0mâ�¤    expecting any of:â�¤        postf…
16:48 dalek faq: 7bfcdb9 | (Konrad Borowski)++ | answers.md:
16:48 dalek faq: Close </span> tags
16:48 dalek faq: review: https://github.com/perl6/faq/commit/7bfcdb9fe9
16:48 konundra joined #perl6
16:48 timotimo r: proto sub do-it(*@foo) { my $radix = 10; if @foo[*-1] ~~ Int { $radix = foo.pop }; nextwith(|@foo, :$radix) }; multi do-it(Str $a, Str $b, :$radix) { say "two strigns" }; multi do-it(Str $a, :$radix) { say "one string" }; do-it("foo", "bar", 90); do-it("foo", "bar"); do-it("foo", 1000);
16:48 moritz r: proto a(:$x = 42) { }; multi a(:$x) { $x }; say a(); # just checking
16:48 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Undeclared routine:â�¤    foo used at line 1â�¤â�¤Â»
16:48 camelia rakudo b19f72: OUTPUT«Nil␤»
16:49 timotimo r: proto sub do-it(*@foo) { my $radix = 10; if @foo[*-1] ~~ Int { $radix = @foo.pop }; nextwith(|@foo, :$radix) }; multi do-it(Str $a, Str $b, :$radix) { say "two strigns" }; multi do-it(Str $a, :$radix) { say "one string" }; do-it("foo", "bar", 90); do-it("foo", "bar"); do-it("foo", 1000);
16:49 camelia rakudo b19f72: OUTPUT«nextwith is not in the dynamic scope of a dispatcher␤  in block  at src/gen/CORE.setting:543␤  in sub do-it at /tmp/qOz6_7ZZpY:1␤  in block  at /tmp/qOz6_7ZZpY:1␤␤»
16:49 timotimo i suppose it should be callwith?
16:49 TimToady timotimo: you can't use nextwith to call into the multi dispatcher
16:49 timotimo r: proto sub do-it(*@foo) { my $radix = 10; if @foo[*-1] ~~ Int { $radix = @foo.pop }; callwith(|@foo, :$radix) }; multi do-it(Str $a, Str $b, :$radix) { say "two strigns" }; multi do-it(Str $a, :$radix) { say "one string" }; do-it("foo", "bar", 90); do-it("foo", "bar"); do-it("foo", 1000);
16:49 camelia rakudo b19f72: OUTPUT«callwith is not in the dynamic scope of a dispatcher␤  in block  at src/gen/CORE.setting:537␤  in sub do-it at /tmp/jb1x6w6Xjg:1␤  in block  at /tmp/jb1x6w6Xjg:1␤␤»
16:49 timotimo how do i do it?
16:49 TimToady nextwith/callwith only work *after* you already have a dispatcher
16:49 moritz r: constant RADIX = 10; multi ndr($v, :$radix = RADIX) { ... }; multi ndr(*@vals, :$radix = RADIX) { ... }
16:49 camelia rakudo b19f72:  ( no output )
16:50 timotimo that does make sense. how do i dispatchwith(...)? ;)
16:50 TimToady and {*} starts the dispatcher in question
16:50 grondilu n: say <foo>.set ⊂ <foo bar>.set
16:50 camelia niecza v24-86-g39ab531: OUTPUT«Unhandled exception: Unable to resolve method set in type Str␤  at /tmp/sEr0x8Z3wn line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4579 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4580 (module-CORE @ 576) ␤  at /home/p6…
16:50 grondilu n: say set(<foo>) ⊂ set(<foo bar>)
16:50 camelia niecza v24-86-g39ab531: OUTPUT«True␤»
16:50 grondilu r: say set(<foo>) ⊂ set(<foo bar>)
16:50 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Two terms in a rowâ�¤at /tmp/boTPchcqK1:1â�¤------> [32msay set(<foo>) [33mâ��[31m⊂ set(<foo bar>)[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix stopperâ�¤        infix or meta-infixâ�¤        statement endâ�¤        statement modifi…
16:50 masak n: say <foo> ⊂ <foo bar>
16:50 camelia niecza v24-86-g39ab531: OUTPUT«True␤»
16:51 masak grondilu: why make things complicated? :)
16:51 grondilu ok, but how do I do that in rakudo?
16:51 TimToady grondilu: what masak++ is trying to say is that most Perl operators are coercive
16:51 masak n: say <foo> ⊂ <foo foo foo foo foo foo foo bar foo>
16:51 camelia niecza v24-86-g39ab531: OUTPUT«True␤»
16:51 masak n: say <foo foo foo foo foo foo foo> ⊂ <foo bar>
16:51 camelia niecza v24-86-g39ab531: OUTPUT«True␤»
16:52 masak r: say <foo foo foo foo foo foo foo> (<) <foo bar>
16:52 camelia rakudo b19f72: OUTPUT«True␤»
16:52 masak grondilu: like that.
16:52 grondilu masak++ thanks
16:52 TimToady rakudo is still a bit allergic to Unicode operators
16:53 * grondilu deplores that (<) messes up Vim syntax higlighting
16:53 notjack Ok, I switched to a named param, it looks better
16:53 TimToady :D
16:53 notjack r: https://gist.github.com/anonymous/5977186
16:53 camelia rakudo b19f72: OUTPUT«3␤»
16:54 notjack is there a way to say, in a sub, "pass all my params to this other sub, but change this one first"?
16:54 notjack the idea being that passing $radix should be implicit
16:55 timotimo you can, in addition to getting your arguments unpacked for you, get a regular capture object from your signature
16:55 timotimo i forgot the signature, though ...
16:55 timotimo er, syntax
16:55 ajr joined #perl6
16:55 abnorman joined #perl6
16:55 TimToady you can't modify the capture in place, because it's immutable, but you can callwith or nextwith a new set of arguments constructed from the old ones
16:56 notjack that'll work
16:56 timotimo nqp: if "foo|bar" ~~ /'|'/ { nqp::say($/.prematch); }
16:56 camelia nqp: OUTPUT«Null PMC access in find_method('prematch')␤current instr.: '' pc 132 ((file unknown):160866105) (/tmp/GXt4dljnLm:1)␤»
16:56 notjack can I figure that from any docs except the (shiver) synopses?
16:56 timotimo the synopses aren't that bad ;)
16:56 [Coke] nqp-jvm: if "foo|bar" ~~ /'|'/ { nqp::say($/.prematch); }
16:56 camelia nqp-jvm: OUTPUT«Lexical '$/' not found␤  in <anon>␤  in <anon>␤  in eval␤  in evalfiles␤  in command_eval␤  in command_line␤  in MAIN␤  in <anon>␤  in <anon>»
16:57 notjack sure, if you've beeen working on them for a decade ;)
16:57 notjack I'm used to being mollycoddled by Perl docs, and that's the way I like it
16:57 * timotimo hasn't spent so much time in them yet
16:57 timotimo nqp: my $res := "foo|bar" ~~ /'|'/; nqp::say($res.prematch);
16:57 camelia nqp: OUTPUT«Method 'prematch' not found for invocant of class 'NQPMatch'␤current instr.: '' pc 139 ((file unknown):171413503) (/tmp/v2YET8tR70:1)␤»
16:57 timotimo mhm.
16:57 notjack p6 doesn't want to coddle any of my mollies
16:58 TimToady notjack: the synopses are greppable; what more could you want?  ;)
16:58 grondilu how do I add an element to a set?
16:58 TimToady you don't
16:58 TimToady sets are immutable too
16:58 grondilu ok
16:59 TimToady you make new set using, say union
16:59 grondilu k
16:59 TimToady or if you want a mutable "set", you use KeySet instead
16:59 grondilu union is (+)?
16:59 TimToady prolly
17:00 grondilu r: say <foo> (+) <bar>
17:00 camelia rakudo b19f72: OUTPUT«bag("foo" => 1, "bar" => 1)␤»
17:00 diakopter notjack: I got it
17:00 diakopter rn: sub ndr(*@vals, Int :$radix is copy where (($radix//=10) > 0)) { 1+floor log (1 max [max] @vals>>.abs), $radix }; say ndr(40,50,60); say ndr(40,50,60,:radix(5)); say ndr(40,50,60, :radix(-1))
17:00 camelia niecza v24-86-g39ab531: OUTPUT«2␤3␤Unhandled exception: Constraint type check failed for parameter '$radix' in 'ndr'␤  at /tmp/xtpHLjH_8o line 0 (ndr @ 1) ␤  at /tmp/xtpHLjH_8o line 1 (mainline @ 10) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4579 (ANON @ 3) ␤  at /home/p6eval/niec…
17:00 camelia ..rakudo b19f72: OUTPUT«2␤3␤Constraint type check failed for parameter '$radix'␤  in sub ndr at /tmp/9Jz7SIBqJO:1␤  in block  at /tmp/9Jz7SIBqJO:1␤␤»
17:00 grondilu n: say <foo> (+) <bar>
17:00 camelia niecza v24-86-g39ab531: OUTPUT«bag("foo" => 1, "bar" => 1)␤»
17:00 TimToady hah, it gave you a bag instead of a set
17:00 grondilu n: say <foo> (u) <bar>
17:00 camelia niecza v24-86-g39ab531: OUTPUT«[31m===[0mSORRY![31m===[0m��Two terms in a row at /tmp/SkWO0Kf8WM line 1:�------> [32msay <foo> [33m�[31m(u) <bar>[0m��Parse failed��»
17:00 grondilu n: say set(<foo>) (+) set(<bar>)
17:01 camelia niecza v24-86-g39ab531: OUTPUT«bag("foo" => 1, "bar" => 1)␤»
17:01 grondilu :/
17:01 TimToady n: say 'foo' ∪ 'bar'
17:01 camelia niecza v24-86-g39ab531: OUTPUT«set(foo, bar)␤»
17:01 TimToady hmm
17:02 TimToady defaulting to bags loses less info, but seems a bit odd in the expectations department
17:02 grondilu n: say set set(<foo>), set(<bar>)
17:02 camelia niecza v24-86-g39ab531: OUTPUT«set(foo, bar)␤»
17:02 grondilu that will do
17:02 TimToady n: say 'foo'.Set ∪ 'bar'
17:02 camelia niecza v24-86-g39ab531: OUTPUT«set(foo, bar)␤»
17:02 TimToady n: say 'foo'.Set ∪ 'bar'.Set
17:02 camelia niecza v24-86-g39ab531: OUTPUT«set(foo, bar)␤»
17:03 TimToady why did yours make a bag instead?
17:03 grondilu I don't know
17:03 TimToady n: say set('foo') ∪ set('bar')
17:03 camelia niecza v24-86-g39ab531: OUTPUT«set(foo, bar)␤»
17:03 notjack diakopter: ah!  //= is ||=
17:03 TimToady n: say set(<foo>) ∪ set(<bar>)
17:03 camelia niecza v24-86-g39ab531: OUTPUT«set(foo, bar)␤»
17:04 notjack or, I mean, does the assign-unless-default thing
17:04 grondilu TimToady: try (+)
17:04 notjack clever
17:04 TimToady n: say set(<foo>) (+) set(<bar>)
17:04 camelia niecza v24-86-g39ab531: OUTPUT«bag("foo" => 1, "bar" => 1)␤»
17:04 TimToady that seems like a bug, one way or another
17:04 notjack diakopter: thanks!
17:04 grondilu indeed
17:04 TimToady a bagbug
17:05 notjack sub ndr(*@vals, Int :$radix is copy where (($radix//=10) > 0)) { 1+floor log (1 max [max]
17:06 TimToady now you just need masak++ to extend macros to more than just terms, and you can define a radix-param macro :)
17:08 timotimo what happened to Int :$radix where $radix > 0 = 10?
17:10 timotimo hum. indent isn't part of nqp? this is tricky! :|
17:12 masak TimToady: jnthn and I plan to corner you about slangs on this YAPC::EU :)
17:12 masak TimToady: but if we finish discussing slangs, maybe we can talk some about macros...
17:12 masak I could even do some combination of mulling and spec-writing before that.
17:14 mst wtf is a slang when it's at home?
17:14 grondilu r:  LOOP: loop { leave LOOP }
17:14 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Two terms in a rowâ�¤at /tmp/TertsiYfGX:1â�¤------> [32mLOOP[33mâ��[31m: loop { leave LOOP }[0mâ�¤    expecting any of:â�¤        argument listâ�¤        postfixâ�¤        infix stopperâ�¤        infix or meta-infixâ�¤        statement endâ�¤        â€¦
17:14 FROGGS labels NYI
17:15 grondilu ok
17:15 TimToady and that's not the syntax for leave anyway; did you mean 'last'?
17:16 TimToady n: LOOP: loop { LOOP.leave(1,2,3) }
17:16 camelia niecza v24-86-g39ab531: OUTPUT«Unhandled exception: Unable to resolve method leave in type Label␤  at /tmp/AAquQPFdos line 1 (ANON @ 2) ␤  at /tmp/AAquQPFdos line 1 (mainline @ 6) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4579 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting …
17:18 FROGGS <TimToady> and that's not the syntax for leave anyway; did you mean 'last'? <--- I'm missing the "in file <unknown> at line 1" :o)
17:18 TimToady n: loop { &?BLOCK.leave(1,2,3) }
17:18 camelia niecza v24-86-g39ab531: OUTPUT«Unhandled exception: Unable to resolve method leave in type Block␤  at /tmp/NJPMwf7abg line 1 (ANON @ 2) ␤  at /tmp/NJPMwf7abg line 1 (mainline @ 4) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4579 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting …
17:18 TimToady n: loop { leave(1,2,3) }
17:18 camelia niecza v24-86-g39ab531: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared routine:â�¤     'leave' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1502 (die @ 5) â�¤  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 36) â�¤  at /ho…
17:18 TimToady ah well
17:23 grondilu TimToady: oh yes I meant "last"
17:35 timotimo can i expect a callmethod 'indent' on a Str to be compile-time evaluated? or should i take care of that myself?
17:39 benabik joined #perl6
17:42 masak PerlJam: my "Fluid Concepts and Creative Analogies" just arrived. \o/
17:42 diakopter mst: I don't get it. :)
17:43 diakopter masak: ready for that rakudobug?
17:43 masak diakopter: sure.
17:45 diakopter rn: https://gist.github.com/diakopter/5976904
17:45 camelia niecza v24-86-g39ab531: OUTPUT«2␤»
17:45 camelia ..rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Missing blockâ�¤at /tmp/ARXDut2Otq:1â�¤------> [32m:$radix is copy where ($radix||=10) > 0 [33mâ��[31m&& True) {[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix stopperâ�¤        infix or meta-infixâ�¤        constraintâ�¤Â»â€¦
17:45 * masak looks
17:45 diakopter (add parens around the where clause and it parses)
17:46 diakopter er, the || there should be //
17:46 masak I think 'is copy where' might be in RT already. hold on.
17:46 spider-mario joined #perl6
17:46 diakopter is copy where is fine
17:46 diakopter there's no bug there
17:47 diakopter adding the is copy enables the //= in both niecza and rakudo, whereas it fails without it
17:47 masak std: sub foo($x where ($x||=10) && True) {}
17:47 camelia std 85cf51d: OUTPUT«ok 00:00 48m␤»
17:47 masak I'm surprised that parses, but OK.
17:47 * masak submits rakudobug
17:47 diakopter why? it's just a cond_statement (to me)
17:47 masak r: sub ndr(*@vals, Int :$radix is copy where ($radix||=10) > 0 && True) {}
17:47 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Missing blockâ�¤at /tmp/pxpVcFpF1n:1â�¤------> [32m:$radix is copy where ($radix||=10) > 0 [33mâ��[31m&& True) {}[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix stopperâ�¤        infix or meta-infixâ�¤        constraintâ�¤Â»â€¦
17:48 masak r: sub ndr($r where ($r ||= 10) > 0 && 1) {}
17:48 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Missing blockâ�¤at /tmp/koM7f5ANdz:1â�¤------> [32msub ndr($r where ($r ||= 10) > 0 [33mâ��[31m&& 1) {}[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix stopperâ�¤        infix or meta-infixâ�¤        constraintâ�¤Â»
17:54 diakopter hm, it wants an infix constraint
17:55 Rotwang joined #perl6
17:58 xilo joined #perl6
17:59 * timotimo now has *some* code to do with heredoc trimming
17:59 timotimo only time and tests will tell if it's actually sensible at all
18:01 flussence so, I "golfed" this line from earlier as best as I can...
18:01 flussence r: say (2/1)**-1
18:01 camelia rakudo b19f72: OUTPUT«Nominal type check failed for parameter 'nu'; expected Int but got Num instead␤  in sub DIVIDE_NUMBERS at src/gen/CORE.setting:8447␤  in sub infix:<**> at src/gen/CORE.setting:8588␤  in sub infix:<**> at src/gen/CORE.setting:3315␤  in block  at /tmp/GC2BUf8rjJ:1␤␤»…
18:01 flussence fun, eh?
18:02 flussence I've no idea what's wrong, but it seems to work fine in nqp.
18:09 timotimo oh, fun! it seems to work!
18:09 timotimo that's unexpected
18:09 ajr joined #perl6
18:09 timotimo er, oops, not actually true :|
18:15 SamuraiJack__ joined #perl6
18:15 ssutch joined #perl6
18:21 itz joined #perl6
18:24 raiph joined #perl6
18:25 SamuraiJack__ joined #perl6
18:26 timotimo heck yeah, my first working version! :)
18:26 timotimo it generates many separate method calls to .indent at the moment, but at least the result is correct, as far as i can see! :)
18:27 FROGGS cool
18:27 FROGGS timotimo++
18:29 timotimo does it seem benign to implement a "dedent" sub just for trim_heredoc?
18:29 abnorman joined #perl6
18:32 masak many separate method calls to .indent is a necessity, if I understand the AST fragments thing correctly.
18:32 timotimo well, all of those fragments are actually constant
18:32 jnthn Yeah, it probably wants something along those lines.
18:32 masak timotimo: right.
18:32 timotimo i'd like to not have many methcall ops in there
18:32 jnthn There's a postprocess thing somewhere...
18:32 timotimo rather, i'd like to do it at compiletime
18:32 masak timotimo: you do know that .indent(*) does de-indenting exactly like you need, right?
18:32 timotimo ... i can just do that on an nqp string?
18:32 timotimo nqp: say(" foo bar".indent(-1))
18:33 camelia nqp: OUTPUT«Method 'indent' not found for invocant of class 'String'␤current instr.: '' pc 50 ((file unknown):166563612) (/tmp/GK05xJvwwK:1)␤»
18:33 timotimo well, not quite :)
18:33 masak hm, probably not in nqp, no.
18:33 jnthn I think we set it up to call the perl 6 one today
18:34 timotimo what, today?
18:34 masak but not at compile time, surely.
18:34 masak since the interpolation must happen at runtime in the general case.
18:34 timotimo yes, but no actual interpolation results have to have .indent called on them
18:34 jnthn Not sure if it does compile time today when the whole thing is literal. Thing it may.
18:35 timotimo it does call .indent on $docast.compile_time_value
18:35 timotimo but i don't know how to make it work with my boxed string
18:35 timotimo can i just (nqp::box_s("  foo bar baz", $*W.find_symbol(["Str"]))).indent(-2)?
18:35 jnthn Yes.
18:36 timotimo surely there must be some trap based on serialisation contexts and such?
18:36 jnthn You need to add the result a a sring constant
18:36 jnthn *as a
18:36 timotimo that's all? spiffy!
18:37 masak architecture++
18:37 timotimo do i need to pass a String or a Str to $*W.add_string_constant?
18:37 jnthn String, I think
18:37 timotimo OK
18:37 timotimo so my call to the indent will be an boxing, a method call and then an unboxing and then adding the string constant?
18:38 * timotimo runs tests
18:39 jnthn yeah, think that'll work
18:41 timotimo hm, can i ~~ /.../ on a Str or do i have to unbox?
18:41 jnthn May work out anyway
18:41 timotimo neato
18:41 jnthn The semantics of how it works out are a bit differnet on Parrot and JVM.
18:42 timotimo that's unfortunate. i'll test on both platforms just in case.
18:42 jnthn Well, I'm saying it should work on both, just that there are subtleties
18:42 jnthn But yeha, it is worth trying both
18:42 timotimo looks very good so far :)
18:52 lizmat joined #perl6
18:52 woolfy1 joined #perl6
18:53 * [Coke] returns from a verrry late lunch.
18:53 timotimo i'll run a spectest just in case ...
18:57 timotimo https://github.com/rakudo/rakudo/pull/176/files - would appreciate a review. running spectests very soon
19:01 notjack what's the equivalent of use strict; use warnings; ?
19:01 [Coke] the default
19:01 [Coke] (you're already running with that, and can't (yet) disable it)
19:03 lizmat_ joined #perl6
19:03 notjack hmm.
19:03 notjack then any idea why the REPL doesn't know what I'm talking about when I say my Int $i; ?
19:03 raiph joined #perl6
19:03 FROGGS notjack: example?
19:04 notjack literally it barfs on that statement.
19:04 TimToady did you already declare $i earlier?
19:04 notjack I'm going to restart the REPL, I may have messed something up.
19:04 [Coke] we'd need to see a screen grab.
19:04 [Coke] WFM here with a rakudo built today.
19:05 [Coke] rakudo.parrot, that is.
19:05 notjack it says "unknown type Str, did you mean str?"
19:05 notjack or Int when I try Int
19:05 notjack hmm, restarting fixed it
19:05 notjack nm
19:08 * grondilu solved an other problem on Rosalind.info, but once again it was with Perl 5, as Perl 6 was way too slow.  Mostly due to slow set operations, I guess.
19:10 * grondilu is very much looking forward to a very fast implementation of Perl 6 (maybe with MoarVM??)
19:11 lizmat joined #perl6
19:14 notjack s/very fast//
19:14 * jnthn does a bit more work on the promises impl :)
19:16 grondilu here is the (slow) code in case you're curious:  https://gist.github.com/grondilu/5978369
19:16 grondilu in P5 it was a few seconds (with full data I mean), and in P6 it was over 5 minutes :/
19:17 stevan_ joined #perl6
19:17 timotimo « » works properly in p6 now?
19:18 timotimo i saw some tests that were marked TODO about that
19:18 masak please be more specific.
19:18 masak oh, the quoting construct?
19:18 jnthn yeha, that's worked since Nov or so
19:18 grondilu r: say join ":", for «'foo bar' 42»
19:18 timotimo oke
19:18 camelia rakudo b19f72: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Undeclared routine:â�¤    for used at line 1â�¤â�¤Â»
19:18 ssutch_ joined #perl6
19:18 grondilu r: say join ":", «'foo bar' 42»
19:18 camelia rakudo b19f72: OUTPUT«foo bar:42␤»
19:18 timotimo wow, that my @split = map { ... } should be more readable as a feed, methinks
19:19 masak r: my $foo = "b c"; .say for <<a $foo d>>;
19:19 camelia rakudo b19f72: OUTPUT«a␤b␤c␤d␤»
19:19 masak \o/
19:20 raiph .tell mst http://perlcabal.org/syn/S02.html#Slangs
19:20 yoleaux 8 Jul 2013 11:30Z <daxim> raiph: I have no context
19:20 yoleaux raiph: I'll pass your message to mst.
19:20 yoleaux 8 Jul 2013 12:52Z <daxim> raiph: promoted to cult leader, eh?
19:20 lestaway joined #perl6
19:20 timotimo what kind of error should be thrown when a heredoc has incorrect dedentation?
19:20 x1 joined #perl6
19:21 timotimo (now that i can reliably figure that out at compile time)
19:21 masak define "incorrect".
19:21 timotimo END is more to the right than text inside the heredoc
19:21 masak what you just said :)
19:21 masak that would be an excellent message, IMO.
19:21 [Coke] timotimo: wouldn't you just try to read the rest of the file?
19:21 masak or warning, whatever.
19:21 rom1504_ joined #perl6
19:22 sunnavy_ joined #perl6
19:22 * masak read that as "what would you like to read for the rest of your life?" :P
19:22 timotimo i still get the "asked to remove * spaces, but the shortest indent is * spaces" from the .indent call; i don't really know how to turn that warning into a prettier warning, though :(
19:22 nebuchad` joined #perl6
19:22 masak timotimo: CATCH it and re-throw?
19:22 timotimo or even how to find out if the warning has happened at all
19:22 sftp joined #perl6
19:23 scottp_ joined #perl6
19:23 timotimo i can catch a warning like that? that's useful
19:23 masak r: sub foo { warn "ouch!" }; foo; CATCH { say "warning caught" }
19:23 camelia rakudo b19f72: OUTPUT«ouch!  in sub foo at /tmp/rrfRMMEdUB:1␤␤»
19:23 PerlJam timotimo: maybe you should try the debugger?
19:23 masak hm..
19:23 timotimo PerlJam: this is at compile time :)
19:23 jnthn CONTROL, not CATCH
19:23 timotimo and in nqp
19:23 PerlJam oh
19:24 PerlJam wait ... nqp has heredocs?
19:24 timotimo no, but the perl6 heredocs are implemented in nqp )
19:24 timotimo ;)
19:25 pmurias jnthn: have you seen the fix-help branch?
19:25 cooper_ joined #perl6
19:26 timotimo r: sub test { warn "oh no" }; test; CONTROL { say "warning caught!" };
19:26 camelia rakudo b19f72: OUTPUT«oh no  in sub test at /tmp/NxYvxXVeqc:1␤␤»
19:26 timotimo r: sub test { warn "oh no" }; try { test; CONTROL { say "warning caught!" }; }
19:26 camelia rakudo b19f72: OUTPUT«warning caught!␤oh no  in sub test at /tmp/uKSCPhcQBv:1␤␤»
19:26 timotimo r: sub test { warn "oh no" }; try { test; CONTROL { default { say "warning caught!" } }; }
19:26 camelia rakudo b19f72: OUTPUT«warning caught!␤»
19:26 timotimo lovely
19:28 timotimo r: sub test { warn "asked to remove a crapton of spaces" }; try { test; CONTROL { when /asked to remove/ { say "warning caught!" } }; }
19:28 camelia rakudo b19f72: OUTPUT«asked to remove a crapton of spaces  in sub test at /tmp/gfknc9QzGX:1␤␤»
19:28 timotimo r: sub test { warn "asked to remove a crapton of spaces" }; try { test; CONTROL { when /asked\ to\ remove/ { say "warning caught!" } }; }
19:28 camelia rakudo b19f72: OUTPUT«warning caught!␤»
19:28 timotimo r: sub test { warn "asked to remove a crapton of spaces" }; try { test; CONTROL { when /:s asked to remove/ { say "warning caught!" } }; }
19:28 camelia rakudo b19f72: OUTPUT«warning caught!␤»
19:28 timotimo great
19:29 GlitchMr- joined #perl6
19:29 raiph notjack: did u mean looking forward to p6.0.0, or to a p6 with less bugs, or a rakudo/mvm with decent spectest coverage, or...?
19:31 GlitchMr- * GlitchMr opuścił/a czat (*.net *.split)
19:31 GlitchMr- Sounds fun
19:31 dalek rakudo-js: 209da3b | (Pawel Murias)++ | runtime/reprs.js:
19:31 dalek rakudo-js: Deserialize repr info for a flattened stable correctly.
19:31 dalek rakudo-js: review: https://github.com/pmurias/rakudo-js/commit/209da3b923
19:31 dalek rakudo-js: 3e37b16 | (Pawel Murias)++ | / (6 files):
19:31 dalek rakudo-js: Compile a subset of QAST::Node. Add a test for creating a simple QAST::Node
19:31 dalek rakudo-js: review: https://github.com/pmurias/rakudo-js/commit/3e37b16ac3
19:31 [Coke] getting a HUGE number of failures in the rakudo.jvm run today.
19:31 [Coke] ... looks like every file is aborting. bah.
19:32 FROGGS O.o
19:32 * pmurias made his commit to nqp in branch, so it's not his fault this time ;)
19:32 pmurias s/branch/a branch/
19:35 lizmat joined #perl6
19:36 ruoso joined #perl6
19:37 vk joined #perl6
19:42 dalek specs: b669c81 | (Elizabeth Mattijsen)++ | S99-glossary.pod:
19:42 dalek specs: Add REPL
19:42 dalek specs: review: https://github.com/perl6/specs/commit/b669c81207
19:42 PacoAir_ joined #perl6
19:42 timotimo how do i set a warning handled in nqp inside a CONTROL block?
19:43 [Coke] lizmat: one of your commits yesterday may have broken rakudo-jvm; bisecting now.
19:43 imarcust- joined #perl6
19:45 sciurius1 joined #perl6
19:45 ugexe_ joined #perl6
19:46 * timotimo is building rakudo.jvm just fine, but may be on an older nqp or something
19:46 [Coke] ... or jnthn. hurm.
19:46 Ulti_ joined #perl6
19:46 [Coke] timotimo: does b19f72b2983c0c601285a04bdaf7f54151820832 work for you?
19:47 timotimo hold on
19:47 [Coke] (jnthn++'s latest commit with threads)
19:47 timotimo yes, it worked
19:47 mst___ joined #perl6
19:47 timotimo and i'm on the newest nqp, too
19:47 snarkyboojum_ joined #perl6
19:48 woolfy1 joined #perl6
19:48 Nom-_ joined #perl6
19:48 timotimo oh, i'm running into the problem where i'm trying to warn from inside a control block
19:49 * [Coke] tries again. :(
19:49 lizmat joined #perl6
19:49 timotimo perhaps some old schmutz hanging around in your folder?
19:50 * jnthn now has .then(...) for attaching "what to do next" to promises :)
19:50 betterwo1ld joined #perl6
19:50 [Coke] timotimo: no, it's a fresh checkout and build every day
19:51 timotimo jnthn: do you have a strategy to make code that works in raduko.jvm and uses async to not crash and burn because of missing "async" sub on rakudo.parrot?
19:51 jnthn timotimo: No
19:51 timotimo as in: if you use async on parrot, it'll just be actually synchronous?
19:51 jnthn There's no fallback for now.
19:52 timotimo OK
19:52 jnthn And I'm not sure to what degree it will help to have it.
19:52 jnthn Given it doesn't actually do what it says...
19:52 timotimo catching the warning and re-making it in a pretty way just causes heredocs with improper left margin to come out pretty mangled instead :(
19:53 jnthn timotimo: For the moment, all of this is really about helping us understand the problem space by providing an implementation of *something*.
19:53 timotimo yeah, that sounds sensible
19:54 * [Coke] wonders if it was a hiccup with the eval server.
19:56 * [Coke] starts it over again with HEAD, seems fine. sorry for the scare.
19:59 ggoebel jnthn: what brand and model laptop do you have? A friend who needs to work while travelling is in search of a new computer. Yours sounds like it'd be up to the task ;-)
20:01 [Coke] ahhh. it was not that everything was failing... but a lot of it is.
20:01 jnthn ggoebel: It's a thinkpad, a T400 that is due a replacement 'cus it's too slow...
20:01 jnthn ggoebel: But it's survived the travel just fine, as did the Thinkpad I had before it.
20:02 ggoebel jnthn: that the one with 16GB ram?
20:02 ggoebel thx
20:02 ilogger2 joined #perl6
20:03 FROGGS ggoebel: I've got a dell with a 90W accu and a 32W accu installed, I can use all cores for hours and hours and hours :o)
20:03 [Coke] at some point, the eval server is dieing.
20:03 rindolf joined #perl6
20:04 [Coke] well, this sucks.
20:04 FROGGS :/
20:05 timotimo shucks :(
20:05 [Coke] I'll see if I can get the daily run cobbled together this evening.
20:05 jnthn ggoebel: This one sure hasn't, but it's a 2-3 year old one.
20:07 timotimo X<...|...,...> now work in Pod::To::HTML :)
20:08 timotimo FSVO "work" ... the class collate the crosslinks, generates <span name="...">...</span> for them, but then does nothing further with it
20:08 FROGGS \o/ yay, we can haz cryptic stuff \o/
20:08 FROGGS ahh, it is about links
20:08 FROGGS err, spans
20:08 timotimo crossreference
20:08 FROGGS yeah
20:08 timotimo most importantly, in the classtut, it won't show up as X<some text!> any more
20:09 timotimo (but also because i changed these to all read X<|something> rather than X<something>
20:14 rindolf joined #perl6
20:17 timotimo tadzik: tell me when you'll have time for some pod hacking next time? i'm thinking it would be beneficial to just merge the pod6-improvements branch into nom for now and later port it to using nibble
20:17 woolfy joined #perl6
20:19 lizmat joined #perl6
20:19 timotimo at least getting the balanced angle brackets fixes out would make the p6docs' to-html version prettier in many places (they often do C<< something something < > >> and that breaks in the current nom version)
20:21 timotimo how unfortunate ... one of the disambiguation pages is called "index.html" m)
20:24 * timotimo watches as more and more memory gets pushed into the swap region
20:25 pmurias jnthn: how are attributes read from a KnowHOWREPR?
20:25 masak timotimo++ # X<..|..>
20:26 tadzik timotimo: oh, it's not merged? :o
20:26 pmurias jnthn: on parrot
20:26 timotimo tadzik: no. but i'd like it if it were ...
20:30 timotimo what magic makes http://doc.perl6.org/routine/Int/ work when locally, a Int.html is actually what's getting created?
20:30 timotimo er
20:30 timotimo what magic makes http://doc.perl6.org/routine/Int work when locally, a Int.html is actually what's getting created?
20:30 timotimo that's what i meant
20:30 * [Coke] would imagine it's an apache config setting?
20:31 timotimo that's rather unhelpful IMO; what if you want to generate the docs locally? you'd have to serve the files with an actual webserver plus a bit of configuration
20:31 timotimo even worse, there's absolute links in the index :|
20:32 [Coke] Seems fixable, but I haven't touched it. where's the repo?
20:32 timotimo perl6/doc
20:33 timotimo ah, it kind of makes sense that they're absolute, given that the url gets generated in Perl6::Documentable, which knows not about the url to the page that's currently being generated
20:33 sjn joined #perl6
20:34 timotimo huh, is "/$.kind/$.name" going to work at all without ()?
20:34 masak yes.
20:35 masak the rule is dollar sign *or* postcircumfix.
20:35 timotimo or. yeah that makes sense
20:35 timotimo so if i want to have $.name.html, would i have to \ that second .?
20:35 masak no.
20:36 timotimo ah, the dollar-sign-rule only goes "one deep"
20:36 masak but it might be more readable if you do.
20:36 masak timotimo: it's looking for a variable to interpolate.
20:36 timotimo in that place it's wrong anyway, i think i'll have to touch url-munge instead
20:36 masak timotimo: a variable can never contain a '.' in that place.
20:36 timotimo that's sensible, yes
20:37 [Coke] arglebargle. something has screwed up my rakudo.parrot install again. seems to happen whenever I use the installed parrot to build a dev rakudo.
20:37 [Coke] (that I don't then install)
20:38 * masak gave up having a globally installed Parrot ages ago, for exactly such reasons
20:38 * [Coke] needs to remember to document how he manages to screw up the installed perl6 in the future closer to when he's done it.
20:38 timotimo the crosslinks in the tutorials is busted :(
20:38 timotimo gets redirected to /routine/...
20:40 timotimo at least that's not a regression from the official version to my local one
20:46 lue I still install parrot to /usr/local. I just have to remember to do make && make all installable && sudo make install, or else
20:48 BenGoldberg joined #perl6
20:57 * [Coke] tries p6doc and wishes for word wrapping and bolded C<> references.
20:58 * [Coke] again chases the installed panda directory...
20:58 timotimo on the terminal?
20:59 timotimo that's certainly something i could try to build some time soon.
20:59 dalek nqp: c81f4d6 | (Solomon Foster)++ | t/jvm/06-sprintf.t:
20:59 dalek nqp: Add first bigint test for sprintf.
20:59 dalek nqp: review: https://github.com/perl6/nqp/commit/c81f4d6f62
20:59 dalek nqp: 55b72b0 | (Solomon Foster)++ | src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java:
20:59 dalek nqp: Make pow_I handle very large powers better.
20:59 dalek nqp: review: https://github.com/perl6/nqp/commit/55b72b0ff6
20:59 colomon joined #perl6
20:59 dalek rakudo/nom: a2f9e0b | (Solomon Foster)++ | src/core/Num.pm:
20:59 dalek rakudo/nom: Special case 1 ** !NaN.
20:59 dalek rakudo/nom:
20:59 dalek rakudo/nom: If someone knows how to make this more efficient, it might be a good idea.
20:59 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a2f9e0bd83
21:00 dalek roast: 649d8b2 | (Solomon Foster)++ | S32-num/power.t:
21:00 dalek roast: Unfudge tests for rakudo.jvm.
21:00 dalek roast: review: https://github.com/perl6/roast/commit/649d8b2b02
21:00 * FROGGS .oO( Moar Efficient(tm) )
21:00 [Coke] installed a fresh perl6. with latest panda, run "perl6 bootstrap.pl" - get lots of failures.
21:01 [Coke] ... because it assumes that it://github.com/tadzik/perl6-File-Tools.git is a valid git url for me. bother.
21:03 [Coke] (the https links would probably be safer for folks behind firewalls)
21:13 masak it:// ?
21:16 nyuszika7h joined #perl6
21:17 [Coke] missing the g
21:17 [Coke] (in my cut and paste only)
21:18 timotimo i'm working on a bit of code to make the lists in doc.perl6.org multi-columned
21:18 timotimo do people very strongly prefer the order to go top to bottom, or would left to right be acceptable ordering, too?
21:18 timotimo (i want the styling to be undoable, too)
21:19 [Coke] you can do that with just CSS, aye?
21:19 timotimo yes
21:20 timotimo a bit of JS will be required to switch between columned and non-columned
21:24 timotimo fortunately, jquery is already in there
21:25 [Coke] Have we thrown in twitter bootstrap yet?
21:26 timotimo haha
21:26 timotimo bootstrap is nice, fwiw.
21:26 [Coke] mmm, we use it at work quite a bit.
21:26 * lue would prefer each list be vertical, but no preferences beyond that.
21:31 timotimo bleh, jquery :|
21:32 flussence JS? what's wrong with ol,ul{column-width: 20em}?
21:33 timotimo ... that exists?
21:33 timotimo also: JS to toggle the behavior
21:34 flussence well it's still browser-prefixed, but it works
21:34 timotimo ah
21:36 sahadev joined #perl6
21:38 timotimo can't get the column-width things work
21:38 flussence huh, oh well
21:38 timotimo it should look like ul { -mox-column-width: 30em; -webkit-column-width: 30em; }?
21:38 flussence er
21:38 flussence -moz-
21:38 timotimo er, yes, that's what i typed
21:39 flussence but that should work, assuming it's got enough width to render two 30em-wide columns in the first place...
21:39 timotimo huh.
21:39 timotimo 30em isn't that huge
21:39 masak timotimo: first of all, this is a CSS3 property, with not much browser support.
21:39 timotimo oh, wow.
21:40 timotimo curiously, it was indeed to big
21:40 masak timotimo: secondly, you should be using it with the other column properties.
21:40 masak see http://www.w3.org/TR/css3-multicol/
21:40 timotimo thanks
21:40 sahadev hello. does the $str.words method (mentioned in http://perl6advent.wordpress.com/2011/12/23/day-23-idiomatic-perl-6/) not available any more?
21:40 flussence I'd link the mozilla docs site page for it, but their search doesn't work *at all*...
21:41 masak r: .say for "foo bar baz".words
21:41 camelia rakudo a2f9e0: OUTPUT«foo␤bar␤baz␤»
21:41 flussence r: say 'eggs eggs eggs'.words.perl
21:41 camelia rakudo a2f9e0: OUTPUT«("eggs", "eggs", "eggs").list␤»
21:41 masak sahadev: yes, it is.
21:41 masak sahadev: why you ask?
21:41 sahadev rakudo: "1 2 3 4 5".words
21:41 camelia rakudo a2f9e0:  ( no output )
21:41 sahadev rakudo: "1 2 3 4 5".words.perl
21:41 camelia rakudo a2f9e0:  ( no output )
21:42 sahadev r: "1 2 3 4 5".words.perl
21:42 camelia rakudo a2f9e0:  ( no output )
21:42 sahadev r: .say for "1 2 3 4 5".words
21:42 camelia rakudo a2f9e0: OUTPUT«1␤2␤3␤4␤5␤»
21:42 timotimo i wonder why, when i set 4 column, the column-width to auto and the width of the whole ul to 100% only about 60% of the width is used, but text overlaps >:(
21:42 sahadev why does it work in the context of for loop, but not as an expression by itself?
21:43 flussence timotimo: looks like the column-count takes precedence over DWIM
21:44 timotimo but without width: auto is supposed to be the default and it doesn't work that way either
21:44 flussence oh wait
21:44 flussence there's a «body{width:730px}» in there.
21:45 timotimo oh!
21:45 timotimo thank you for noticing that; that would explain why 100% means that
21:46 timotimo so column-count: 2 would be the most we can get out of that
21:47 lizmat joined #perl6
21:48 grondilu sahadev: the bot does not say anything if you don't ask him to do so.
21:48 grondilu r: say "1 2 3 4 5".words
21:48 camelia rakudo a2f9e0: OUTPUT«1 2 3 4 5␤»
21:49 grondilu r: say "1 2 3 4 5".words.perl # (just to be clear)
21:49 camelia rakudo a2f9e0: OUTPUT«("1", "2", "3", "4", "5").list␤»
21:50 grondilu r: say 3 Rxx rand
21:50 camelia rakudo a2f9e0: OUTPUT«0.899653583855496 0.899653583855496 0.899653583855496␤»
21:50 grondilu n: say 3 Rxx rand
21:50 timotimo i'd like to split off all X:: classes from all the other classes. in favor?
21:50 camelia niecza v24-86-g39ab531: OUTPUT«0.17050418545049811 0.17050418545049811 0.17050418545049811␤»
21:50 sahadev grondilu: thanks.
21:52 lizmat r: my @a=Parcel.new; say @a.WHAT
21:52 camelia rakudo a2f9e0: OUTPUT«elements() not implemented in class 'Mu'␤  in method reify at src/gen/CORE.setting:6027␤  in method gimme at src/gen/CORE.setting:6453␤  in method eager at src/gen/CORE.setting:6432␤  in method STORE at src/gen/CORE.setting:6977␤  in block  at /tmp/C9nvYHtip9:1␤␤»…
21:52 jnthn r; say Parcel.new
21:52 jnthn r: say Parcel.new
21:52 camelia rakudo a2f9e0: OUTPUT«get_iter() not implemented in class 'Mu'␤  in method gist at src/gen/CORE.setting:5629␤  in method gist at src/gen/CORE.setting:915␤  in sub say at src/gen/CORE.setting:11438␤  in block  at /tmp/oNdT8Zphz9:1␤␤»
21:53 jnthn I think Parcel is to blame.
21:53 timotimo who can i pester to include 1) my heredoc trimming fixes and 2) my older pod6-improvements branch (which i will PR now)
21:58 tadzik timotimo: I see your pull request, I promise to review it tomorrow
21:58 timotimo \o/
21:58 tadzik I'll be a stay-at-home tadzik, waiting for my piano to be delivered :)
21:58 timotimo oh, a piano!
21:58 tadzik yeah, trying to get back to it
21:59 tadzik I hope that the pile of money I spent on it will at least motivate me to put it to good use :P
21:59 timotimo =)
22:01 konundra joined #perl6
22:02 timotimo a full run of p6doc takes about 12 minutes on my box :(
22:02 stevan_ joined #perl6
22:04 stevan_ joined #perl6
22:07 sahadev how can this be improved? .say for (bag($text.words) ==> sort {$^b.value <=> $^a.value})[^10]  # show top 10 words in $text by frequency
22:12 dmol joined #perl6
22:13 timotimo you can sort { *.value }
22:13 lizmat joined #perl6
22:14 timotimo if you want to invert it, sort by -*.value
22:14 dalek rakudo/nom: 8e07625 | (Elizabeth Mattijsen)++ | src/core/Parcel.pm:
22:14 dalek rakudo/nom: Make sure Parcel.new actually works
22:14 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8e076257f7
22:15 masak tadzik++ # piano
22:15 masak I should totally get a piano...
22:16 sahadev timotimo: nice
22:19 tadzik I'll tell you if it's fun ;)
22:21 grondilu tadzik: digital or mechanic?  (just curious)
22:23 stevan_ joined #perl6
22:24 tadzik grondilu: digital and mechanic :)
22:24 tadzik if it wasn't digital my neighbours would probably raid my flat
22:25 tadzik but it's got all those little hammers that just hit electronics rather than strings
22:28 lue .oO(But with a mechanical piano you could detune it to the point of frustrating all who attempt to play!)
22:30 timotimo you can surely hack an electronic piano to do the same thing
22:31 thundergnat joined #perl6
22:31 lue Sure. (I'd especially expect such a thing from an electronic keyboard *with hammers*.)
22:33 lizmat joined #perl6
22:34 timotimo i'd love to improve p6doc to display formatting codes with ansi terminal things, but optional run-time-importation doesn't really seem to work yet :(
22:34 timotimo hm, except maybe with eval?
22:35 FROGGS joined #perl6
22:35 timotimo r: my &colored; say try eval q{ use Term::ANSIColor; &colored };
22:35 camelia rakudo a2f9e0: OUTPUT«Nil␤»
22:35 timotimo star: my &colored; say try eval q{ use Term::ANSIColor; &colored };
22:35 camelia star 2013.02: OUTPUT«sub colored(Str $what, Str $how) { ... }␤»
22:35 timotimo oh yeah, why didn't i think of that sooner?
22:38 timotimo oh. tadzik it seems somewhere along the way tables got b0rked or something. i'll investigate
22:39 thundergnat .tell masak When you get a chance, could you take a look at my CSV pull request?
22:39 yoleaux thundergnat: I'll pass your message to masak.
22:40 timotimo oh, of course, the commit even says "first (wrong) attempt to parse fcodes in table cells"
22:40 timotimo no wonder it's wrong...
22:40 timotimo but the pull request doesn't contain that commit, so that's good.
22:44 dalek doc: 83203f5 | (Timo Paulssen)++ | lib/ (3 files):
22:44 dalek doc: fix improper code blocks, X<...> formatting codes.
22:44 dalek doc: review: https://github.com/perl6/doc/commit/83203f5da3
22:44 BenGoldberg joined #perl6
22:49 skids joined #perl6
22:52 timotimo does controlling wether or not Pod::To::Text should output ansi escape codes via an environment variable seem at all sensible?
22:53 timotimo i think it does.
22:56 * timotimo mops up things all over the place :|
22:58 timotimo apparently S26 generates a twine that has a string as its second element >_>
23:01 timotimo yes, i can see what's wrong
23:05 thundergnat left #perl6
23:17 berekuk joined #perl6
23:22 masak 'night, #perl6
23:22 yoleaux 22:39Z <thundergnat> masak: When you get a chance, could you take a look at my CSV pull request?
23:22 * masak queues this up for tomorrow :)
23:23 timotimo gnite masak :)
23:32 Ben_Goldberg joined #perl6
23:34 ruoso joined #perl6
23:35 timotimo fixed and pull request updated, tadzik. things should be fine for your review tomorrow
23:37 ssutch joined #perl6
23:48 timotimo ... wha? it just worked a few seconds ago and now it stopped working? :(
23:57 * TimToady once tuned an (analog) electronic piano
23:57 TimToady had little tines that vibrate, with lead weights on the end
23:57 timotimo was the electric part a bit like an electric guitar?
23:57 TimToady you raise the pitch by removing some of the weight
23:58 timotimo huh, that's interesting. is that technology still in use?
23:58 TimToady don't remember, but could be
23:58 TimToady lowering is harder, you have to file the shoulders of the tine
23:58 TimToady this was more than 40 years ago...
23:59 TimToady (or add weight)

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

Perl 6 | Reference Documentation | Rakudo