Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-06-20

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:06 webstrand_ joined #perl6
00:12 huggable joined #perl6
00:21 stevieb reading through some perl6 test suite to learn as I write my own, and am wondering if the line in the following link should say "can call public method from outside the class". I just am trying to confirm what I'm trying to grasp. https://github.com/perl6/roast/blob/master/S12-methods/private.t#L17
00:23 Zoffix stevieb, the test calls public `public` that in turn calls a private method from within that class, which is what the test tests
00:23 Zoffix The call is on line 13
00:24 stevieb d'oh! a case of not paying enough attention :)
00:25 stevieb so effectively, it's just ensuring that the private method can and is being called, by using a public method. Thanks Zoffix
00:38 AlexDaniel joined #perl6
00:41 tbrowder 'ello p6 people, just attended, at YAPC::NA::2016, a day full of damian waxing wonderfully on p6 trans paradigm programming, and he got us all excited about p6 and p6 grammars
00:43 llfourn tbrowder: can't wait for vid
00:43 Zoffix llfourn, won't be. It's a paid course.
00:43 llfourn oh =(
00:44 Zoffix He'll be in Toronto for Jun 27 and 28. Maybe you can attend :)
00:45 tbrowder so my question for the experts here is: how can I use p6 grammar to parse a code block and print out a parse tree (a simple example needed)? Damian showed an example of doing such with an example grammar, but how can we do the same thing with a chunk of p6 code?
00:45 llfourn I guess no vid there either?
00:45 llfourn I'm in australia so It's tricky
00:46 Zoffix llfourn, there will be and you can view live through google hangout.
00:46 llfourn oh sweet
00:46 * llfourn marks the calendar
00:46 Zoffix llfourn, this is the first one: http://www.meetup.com/Toronto-Perl-Mongers/events/231418224/
00:47 Zoffix And the other one: http://www.meetup.com/Toronto-Perl-Mongers/events/231418278/
00:47 llfourn Zoffix: cheers!
00:49 tbrowder I think we need to use nqp, but I'm not positive about it
00:49 llfourn tbrowder: you can do perl6 --target=parse to "print it out"
00:50 llfourn but if you want to get the nqp match object for actually using in code there is a way
00:50 llfourn but it's slightly more involved
00:51 tbrowder that's what I want (read: "need to do for debugging p6 grammar")
00:51 Zoffix tbrowder, there's Grammar::Debugger
00:51 llfourn ^^ it's *very* useful
00:52 Zoffix tbrowder,
00:52 Zoffix tbrowder, https://github.com/jnthn/grammar-debugger
00:52 Zoffix tbrowder, inside of it is Grammar::Tracer that's neat
00:52 tbrowder thanks, I'll try that...
00:53 llfourn tbrowder: oh did you mean you need it for debugging *the* Perl 6 grammar or *a* grammar written in Perl 6?
00:56 Zero_Dogg joined #perl6
00:58 tbrowder ref: damian: I (and others) asked him about p6 best practices and his basic reply was he hasn't written enough code to determine that yet, but I was interested specifically in how he call a sub in 06 compared to p5 and he now seems to favor the list approach versus parens (opposite to p5 because of the vagaries of p5); specifically he likes the call using
00:58 tbrowder the list approach this way for sub foo (which I'm not sure I've seen documented), e.g., "foo: arg1, arg2;" (note the colon introducing the args)
00:59 tbrowder llfourn: *the* Perl 6 grammar
01:00 Zoffix m: sub foo { say $^a, $^b }; foo: 2, 3
01:00 camelia rakudo-moar 1d93ad: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 2 in sink context (lines 1, 1)␤Useless use of constant integer 3 in sink context (lines 1, 1)␤»
01:00 stevieb m: sub foo($x){$x.say}; foo: 1;
01:00 camelia rakudo-moar 1d93ad: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (line 1)␤»
01:00 llfourn it's only for Object.foo:
01:00 Zoffix tbrowder, ? are you sure he wasn't talking about methods and not subs
01:01 stevieb Zoffix: one line above your question
01:01 tbrowder hm, method for sure, but I thought subs, too (but I'm not a great listener)
01:02 Zoffix :)
01:02 stevieb m: class X{method foo($x){$x.say}}; my $x=X; $x.foo: 1;
01:02 camelia rakudo-moar 1d93ad: OUTPUT«1␤»
01:05 tbrowder m: sub foo ($x) { say $x } foo: 1
01:05 camelia rakudo-moar 1d93ad: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3sub foo ($x) { say $x }7⏏5 foo: 1␤    expecting any of:␤        infix␤        infix stopper␤        statement end…»
01:05 tbrowder m: sub foo ($x) { say $x } ;foo: 1
01:05 camelia rakudo-moar 1d93ad: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (line 1)␤»
01:05 tbrowder m: sub foo ($x) { say $x } ;foo: 1;
01:05 camelia rakudo-moar 1d93ad: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (line 1)␤»
01:06 Zoffix joined #perl6
01:06 stevieb tbrowder: only works on an object:
01:06 tbrowder hm, i guess i was asleep
01:06 stevieb m: class X{method foo($x){$x.say}}; my $x=X; $x.foo: 1;
01:06 camelia rakudo-moar 1d93ad: OUTPUT«1␤»
01:07 Zoffix m: class X{method foo($x){$x.say}}; my $x=X; foo $x: 1;
01:07 camelia rakudo-moar 1d93ad: OUTPUT«1␤»
01:07 Zoffix Oh!
01:07 Zoffix For the first time, that usage clicked for me.
01:07 Zoffix Doesn't look odd and weird anymore :)
01:08 Zoffix method meth (obj: param) -> meth obj: param
01:09 stevieb I see how that works... took me a minute
01:09 tbrowder well, in my defense he was mainly using methods heavily, and, as usual, i assumed too much
01:10 tbrowder Util was there, and he was much smarter and more alert
01:10 webstrand joined #perl6
01:10 llfourn tbrowder: sorry I can't remember how to get a parse tree from Perl6::Gramamr, though I know it's possible.
01:12 llfourn m: use nqp; my $comp = nqp::getcomp("perl6"); note $comp.compile("say q|hello world|",:target<parse>) # semething lke this but must be missing a step
01:12 camelia rakudo-moar 1d93ad: OUTPUT«===SORRY!===␤compunitmainline requires an MVMCompUnit␤»
01:14 tbrowder I have a couple more classes with damian and I'll try to be more exacting
01:14 llfourn does damian hack much on nqp though?
01:16 llfourn m: use nqp; my $comp := nqp::getcomp("perl6"); my $p := $comp.eval("say q|hello world|",:target<parse>); note $p.dump # I DID IT!
01:16 camelia rakudo-moar 1d93ad: OUTPUT«- statementlist: say q|hello world|␤  - statement: 1 matches␤    - EXPR: say q|hello world|␤      - longname: say␤        - name: say␤          - identifier: say␤      - args:  q|hello world|␤        - arglist: q|hello world|␤          - EX…»
01:16 llfourn tbrowder: ^^
01:16 tbrowder hm, I just tried with perl6 repl and this worked:
01:16 tbrowder m: sub foo($x){say $x}; foo: 3;
01:16 camelia rakudo-moar 1d93ad: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 3 in sink context (line 1)␤»
01:16 tbrowder so what's going on???
01:17 llfourn doesn't work for me?
01:17 webstrand_ joined #perl6
01:17 tbrowder what rakudo?
01:17 geekosaur : is only used with methods, not subs
01:17 geekosaur you have in your example a label "foo:" and a value in sink context (which produces a warning)
01:17 llfourn well camelia is usually the latest?
01:19 tbrowder got to go to bed, but this is interesting; would appreciate a simple example of testing p6 grammar, g'night!
01:20 llfourn tbrowder: night
01:21 molaf joined #perl6
01:41 webstrand joined #perl6
01:46 FROGGS joined #perl6
01:47 ilbot3 joined #perl6
01:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:49 Xliff joined #perl6
02:11 Khisanth joined #perl6
02:11 webstrand joined #perl6
02:14 ssotka joined #perl6
02:22 noganex joined #perl6
02:33 webstrand joined #perl6
02:34 nchambers joined #perl6
03:36 Util geekosaur: ": is only used with methods, not subs" is _almost_ true.
03:36 Util geekosaur, tbrowder, llfourn: See "infix:<:>, the invocant marker" at http://design.perl6.org/S03.html#Comma_operator_precedence
03:37 Util Specifically: "The special form is recognized only after a dotty method call, or after the right parenthesis of a method or function call."
03:37 * Util returns to slide making (sliding?)
03:37 llfourn o.o
03:38 llfourn m: my @a; @a.push(): 4,5,6; say @a;
03:38 camelia rakudo-moar 1d93ad: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3my @a; @a.push():7⏏5 4,5,6; say @a;␤    expecting any of:␤        colon pair␤»
03:38 llfourn m: my @a; push(@a): 4,5,6; say @a;
03:38 camelia rakudo-moar 1d93ad: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3my @a; push(@a):7⏏5 4,5,6; say @a;␤    expecting any of:␤        colon pair␤»
03:39 llfourn m: my @a; push(@a, 1,2,3): 4,5,6; say @a;
03:39 camelia rakudo-moar 1d93ad: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3my @a; push(@a, 1,2,3):7⏏5 4,5,6; say @a;␤    expecting any of:␤        colon pair␤»
03:39 llfourn seems like that's either NYI or the idea was dropped?
03:41 colomon joined #perl6
03:41 Util llfourn: Hmmm. Good tests; I think I agree (NYI|dropped). Finding it in the doc is as far as I can take it tonight.
03:57 rgrinberg joined #perl6
04:07 Zoffix Is there a way to use a variable for the base with the :16('Str') notation?
04:07 Zoffix m: $_ = '36'; say :"$_"('FIZZ').base: 35
04:07 camelia rakudo-moar 1d93ad: OUTPUT«5===SORRY!5===␤Argument to "say" seems to be malformed␤at <tmp>:1␤------> 3$_ = '36'; say7⏏5 :"$_"('FIZZ').base: 35␤Confused␤at <tmp>:1␤------> 3$_ = '36'; say :7⏏5"$_"('FIZZ').base: 35␤    expecting any of:␤        colon pa…»
04:08 Cabanossi joined #perl6
04:12 huggable joined #perl6
04:21 Zoffix m: say 32..2
04:21 camelia rakudo-moar 1d93ad: OUTPUT«32..2␤»
04:21 Zoffix m: say 32…2
04:21 camelia rakudo-moar 1d93ad: OUTPUT«(32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2)␤»
04:21 Zoffix <3 Perl 6
04:25 TEttinger joined #perl6
04:41 Zoffix m: 5.base: 1
04:41 camelia rakudo-moar 1d93ad: OUTPUT«base argument to base out of range. Is: 1, should be in 2..36␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
04:41 Zoffix Disserpointing! :)
04:45 Zoffix m: use MONKEY-TYPING; augment class Int { multi method base(1) { '0' x self } }; say 5.base: 1
04:45 camelia rakudo-moar 1d93ad: OUTPUT«00000␤»
04:45 Zoffix \o/
04:47 Zoffix m: https://gist.github.com/zoffixznet/be1ba87c994864f8cf14ce5cacc96bdb
04:47 camelia rakudo-moar 1d93ad: OUTPUT«This representation (Null) does not support elems (for type VMNull)␤  in any  at /home/camelia/rakudo-m-inst-1/share/perl6/runtime/CORE.setting.moarvm line 1␤  in method base at <tmp> line 2␤  in block  at <tmp> line 7␤  in block  at <tmp> line 6…»
04:48 Zoffix ¯\_(ツ)_/¯
04:52 Zoffix m: say "0" x :36("FIZZBUZZ")
04:52 camelia rakudo-moar 1d93ad: OUTPUT«repeat count > 1073741824 arbitrarily unsupported...␤  in block <unit> at <tmp> line 1␤␤»
04:52 Zoffix probably 'cause of that
04:52 Zoffix 1am :'( gotta wake up at 6:30am. Gonna look at this writing and think self stupid in the morning lol :)
04:54 llfourn what's the idomatic way to check that every element of an array is an Int?
04:58 llfourn m: sub foo(@a where  { .all ~~ Int }) { }; foo([1,2,3]) # works
04:58 camelia rakudo-moar 1d93ad: ( no output )
04:58 llfourn m: sub foo(@a where *.all ~~ Int) { }; foo([1,2,3]) # doesn't
04:58 camelia rakudo-moar 1d93ad: OUTPUT«Constraint type check failed for parameter '@a'␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
05:16 Xliff m: sub foo(@a where * ~~ Int) { }; foo([1,2,3])
05:16 camelia rakudo-moar 1d93ad: OUTPUT«Constraint type check failed for parameter '@a'␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
05:17 Xliff ¯\_(ツ)_/¯
05:27 _28_ria joined #perl6
05:43 domidumont joined #perl6
05:47 lizmat joined #perl6
05:48 woolfy joined #perl6
05:52 Util llfourn: Someday, it will be `sub foo( Int @a ) {...}` . The failing today is that [1,2,3] is not automatically an Array of Int.
05:53 Util m: sub foo(Int @a) { say @a.perl; }; foo([1,2,3]);
05:53 camelia rakudo-moar 1d93ad: OUTPUT«Type check failed in binding @a; expected Positional[Int] but got Array ($[1, 2, 3])␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
05:53 Util m:sub foo(Int @a) { say @a.perl; }; my Array[Int] $z .= new: 1, 2, 3;   foo($z);
05:53 Util m: sub foo(Int @a) { say @a.perl; }; my Array[Int] $z .= new: 1, 2, 3;   foo($z);
05:53 camelia rakudo-moar 1d93ad: OUTPUT«Array[Int].new(1, 2, 3)␤»
05:53 Util m: sub foo(Int @a) { say @a.perl; }; my Array[Int] $z .= new: 1, 2, 3.5; foo($z);
05:53 camelia rakudo-moar 1d93ad: OUTPUT«Type check failed in assignment to ; expected Int but got Rat (3.5)␤  in block <unit> at <tmp> line 1␤␤»
05:53 Util In the meantime, your .all solution looks good.
05:53 llfourn Util: there has been discussion of making [1,2,3] automatically an array of Int?
06:02 psch i don't think we can do that
06:02 psch types are nominal, after all
06:02 llfourn right.
06:03 psch which i understand as "you have to tell the compiler what type you want here, or it'll be Any"
06:03 psch well, in this instance, and practically speaking only
06:04 llfourn m: say [1,2,3] ~~ Array[Int]
06:04 camelia rakudo-moar 1d93ad: OUTPUT«False␤»
06:04 llfourn I feel like there should be a way of easily creating a runtime test against Array[Int]
06:05 llfourn like shorthand for say [1,2,3] ~~ subset RuntimeArrayIntTest of Array where { .all ~~ Int }
06:05 llfourn Array[Int].subset #maybe?
06:06 jjido joined #perl6
06:06 psch but [1,2,3] is no Array[Int].  it's Array[Any]
06:06 psch that's kind of the point, really :)
06:06 llfourn yes but I want a quick syntax to create the corresponding runtime check
06:07 psch what's wrong about a sub (or two multis) that returns True or False if that check passes?
06:07 psch stuff it into some List::Util module if you need it that often
06:07 llfourn maybe a module is the solution
06:07 psch and like, [1,2,3].all({ $_ ~~ Int }) is shorter and does the same
06:08 llfourn yeah but it is ugly
06:08 * psch doesn't think so
06:08 llfourn doing foo( @a where { .all ~~ Int } ); all the time seems wrong
06:09 psch well, alternative you can declare @a as Int @a
06:09 llfourn well, usually the problem occurs for me in attributes
06:09 psch and create typed arrays when you need them consistenly
06:09 psch +t
06:09 domidumont joined #perl6
06:09 llfourn right the problem is for attribtues not subs
06:10 psch m: class A { has Int @.a }; A.new(a => @ = Array[Int].new(1,2,3)).perl.say
06:10 camelia rakudo-moar 1d93ad: OUTPUT«A.new(a => Array[Int].new(1, 2, 3))␤»
06:10 psch alternatively put the ~~ Int check into BUILD
06:10 llfourn yeah that's what I want to avoid here :)
06:11 psch what?  putting it into BUILD?
06:11 llfourn writing runtime type check code
06:11 psch then use types consistenly and force your users to use them as well vOv
06:11 llfourn my %h = (:a<1 2 3>); sub (Int :@a) { say @a }.(a => %h<a>) # this roughly approximates the problems I run into
06:11 llfourn m: my %h = (:a<1 2 3>); sub (Int :@a) { say @a }.(a => %h<a>) # this roughly approximates the problems I run into
06:11 camelia rakudo-moar e3a3d2: OUTPUT«Type check failed in binding @a; expected Positional[Int] but got List ($(IntStr.new(1, "1"),...)␤  in sub  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
06:12 domidumont joined #perl6
06:12 llfourn I'd rather let my users throw whatever at it and just have runtime checks in some situations.
06:12 psch okay, so you want to have runtime checks but don't want to write them yourself..?
06:12 llfourn but I'd like to have a quick way to wip up a runtime check
06:12 llfourn exactly
06:12 psch i mean, i'm sorry but i really don't see the problem
06:13 llfourn maybe a module is the solution...
06:13 jjido joined #perl6
06:13 llfourn well perl 5 has Type::Tiny
06:13 psch i don't see how ~20 chars is not "a quick way to wip (sic) a runtime check"
06:13 llfourn for this purpose
06:13 llfourn because it's declaritive rather than procedural
06:14 psch i don't think i agree with that
06:14 llfourn ok well different preferences then :)
06:14 psch declarative type checks are when you declare (like, in a signature or declarator) the type
06:14 psch checking the content of an under-typed array during e.g. BUILD looks very procedural to me
06:15 llfourn yeah so, sub foo(@a where IntArray) { } is nicer than foo(@a where { .all ~~ Int }
06:15 psch that i think is preference.  they do (depending on IntArray) the same thing
06:16 llfourn that's all I'm saying -- and since it's a common pattern I might write a module to produce corresponding runtime checks for types like Array[Int]
06:16 psch in any case, i think, specifically regarding Attributes, a trait might look nice for what you're trying
06:17 llfourn hmm that's an interesting idea..
06:22 firstdayonthejob joined #perl6
06:25 _mg_ joined #perl6
06:25 psch hm, although moving the trait result to the right spot might be a bit difficult
06:25 psch maybe you'd be better of with a different metaclass that gives you that kind of check for all aggregate Attributes
06:26 psch or maybe just a different metaclass for Attributes
06:27 llfourn I think what I really want is parameterized subset. like has Arrayish[Int] $.a; where Arrayish behaves like Array[Int] in Type::Tiny.
06:30 domidumont joined #perl6
06:32 mls_ joined #perl6
06:38 jjido joined #perl6
06:45 Actualeyes joined #perl6
06:52 grondilu joined #perl6
07:00 moritz Zoffix++ # Rakudo #100
07:08 masak good Monday, #perl6
07:08 masak ooh, Zoffix++ # rel
07:12 abraxxa joined #perl6
07:13 darutoko joined #perl6
07:15 masak arnsholt: warm congratulations on the 3-days-old. (4-days-old now, I guess. they grow up so fast!)
07:19 moritz ooh, I missed that! arnsholt++
07:19 moritz and arnsholt.family++ :-)
07:20 wamba joined #perl6
07:23 jjido joined #perl6
07:30 BenGoldberg joined #perl6
07:33 zzzzzzzzz joined #perl6
07:54 lizmat joined #perl6
07:57 woolfy joined #perl6
07:58 abraxxa arnsholt: congratulations as well!
08:03 bjz joined #perl6
08:09 cur8or joined #perl6
08:12 huggable joined #perl6
08:12 dakkar joined #perl6
08:13 _28_ria joined #perl6
08:14 vytas joined #perl6
08:15 brrt joined #perl6
08:16 RabidGravy joined #perl6
08:25 araujo joined #perl6
08:36 sno joined #perl6
08:42 rindolf joined #perl6
08:44 bjz joined #perl6
08:49 CIAvash joined #perl6
08:51 iH2O joined #perl6
08:52 iH2O left #perl6
08:56 andrewalker joined #perl6
08:57 ocbtec joined #perl6
08:59 bjz joined #perl6
08:59 rkr joined #perl6
09:02 donaldh joined #perl6
09:06 arnsholt Thank you, everyone! =)
09:08 jnthn Morning, #perl6
09:08 jnthn arnsholt: Congrats from me also! :-)
09:08 moritz mornthn
09:09 hahainternet morning all, congratulations arnsholt
09:09 masak wow, it took us until 2016 to come up with "mornthn"!? :P
09:09 g4 joined #perl6
09:10 jnthn Sounds like the kind of sound I make in a morning :P
09:10 RabidGravy :)
09:11 RabidGravy I'm well into my second coffee and still haven't woken up fully
09:11 hahainternet 1/2 way through my tea :)
09:12 tadzik yay, congrats arnsholt!
09:14 Zero_Dogg joined #perl6
09:17 * brrt backlogs
09:18 brrt congrats arnsholt :-)
09:19 arnsholt masak: jnthn is chief punsmith of #perl6, but I guess he couldn't come up with that particular one himself. So he had to wait for someone else to do it =)
09:20 * masak .oO( eventual pun-ishment )
09:22 zakharyas joined #perl6
09:22 araujo_ joined #perl6
09:24 kerframil joined #perl6
09:28 rkr joined #perl6
09:29 rkr joined #perl6
09:36 buharin joined #perl6
09:44 buharin sup
09:45 El_Che joined #perl6
09:53 arnsholt masak: I tried to make an eventual consistency-based follow-up pun to that, but failed sadly =(
09:58 kerframil joined #perl6
10:07 El_Che joined #perl6
10:23 colomon joined #perl6
10:23 jjido joined #perl6
10:24 rgrinberg joined #perl6
10:50 kid51 joined #perl6
10:50 kid51 joined #perl6
10:51 kid51 joined #perl6
10:58 sjoshi joined #perl6
10:58 eroux joined #perl6
10:59 brrt joined #perl6
11:12 Emeric joined #perl6
11:14 eugen joined #perl6
11:18 xnrand joined #perl6
11:21 masak arnsholt: don't worry; you'll succeed... eventually :P
11:22 _mg_ joined #perl6
11:25 bartolin joined #perl6
11:25 arnsholt I'll make sure to tell you when I do!
11:29 masak push-based ftw
11:37 stmuk_ joined #perl6
11:42 xnrand joined #perl6
11:43 Gothmog_ joined #perl6
11:53 [Coke] .
12:12 huggable joined #perl6
12:12 baest_ joined #perl6
12:12 bjz joined #perl6
12:13 shmibs joined #perl6
12:15 Grrrr joined #perl6
12:15 stmuk_ joined #perl6
12:16 llfourn joined #perl6
12:16 yanmc joined #perl6
12:16 dj_goku joined #perl6
12:16 dj_goku joined #perl6
12:16 mr-foobar joined #perl6
12:17 dalek doc: b7f2831 | (Tom Browder)++ | doc/Programs/README.md:
12:17 dalek doc: add info on doc sorting in this directory
12:17 dalek doc: review: https://github.com/perl6/doc/commit/b7f2831433
12:17 dalek doc: 7e1403a | (Tom Browder)++ | doc/Programs/README.md:
12:17 dalek doc: Merge pull request #607 from tbrowder/readme-prog-files
12:17 dalek doc:
12:17 dalek doc: add info on doc sorting in this directory
12:17 dalek doc: review: https://github.com/perl6/doc/commit/7e1403a7ba
12:19 lizmat joined #perl6
12:20 gregf_ joined #perl6
12:20 buharin hey, I am reading last time Perl6 documentation
12:20 buharin but there are some lacks of information
12:21 buharin if I want to fullfill it, I need PR on git?
12:21 cosarara joined #perl6
12:21 lizmat buharin: yes please
12:22 buharin lizmat: thank you my friend
12:23 grondilu joined #perl6
12:24 jferrero joined #perl6
12:24 literal m: my %a = foo => 5; my %b = bar => 6; say %a »+« %b
12:24 camelia rakudo-moar e3a3d2: OUTPUT«Use of uninitialized value of type Any in numeric context  in block <unit> at <tmp> line 1␤Use of uninitialized value of type Any in numeric context  in block <unit> at <tmp> line 1␤{bar => 6, foo => 5}␤»
12:24 literal those warnings shouldn't happen, right?
12:25 kmwallio joined #perl6
12:25 cosimo joined #perl6
12:25 gfldex m: my %a = foo => 5; say (+%a).WHAT
12:25 camelia rakudo-moar e3a3d2: OUTPUT«(Int)␤»
12:26 literal maybe my code example is outdated, I got it from S03
12:26 literal from a section saying that this would give you a union of the keys
12:28 grondilu joined #perl6
12:29 cognominal joined #perl6
12:29 autarch joined #perl6
12:32 Woodi joined #perl6
12:33 [Coke] tbrowder: regarding #607 on docs... why *is* it different for this folder?
12:33 [Coke] is the goal for them all to be the same at some point?
12:34 [Coke] literal: are you reading S03 via the web or the repo?
12:34 krakan joined #perl6
12:34 [Coke] (the website has a message at the top)
12:43 bhm joined #perl6
12:45 andreoss joined #perl6
12:45 mattp_ joined #perl6
12:46 andreoss is there a variable for a separator character for PATH variable?
12:47 timotimo i think there is one
12:48 literal [Coke]: yeah, the webpage
12:48 literal I did notice the message :)
12:48 [Coke] m: $*DISTRO.path-sep.say
12:48 camelia rakudo-moar e3a3d2: OUTPUT«:␤»
12:49 stevieb ohhh that's handy!
12:49 andreoss [Coke]: thanks, docs are missing this one
12:50 * masak .oO( ohhh that's ✋y )
12:50 andreoss is there a function which parses PATH variables?
12:50 masak andreoss: .comb($*DISTRO.path-sep) :)
12:50 masak er, .split, of course
12:50 gfldex m: IO::Spec::Unix.new.dir-sep.say
12:50 camelia rakudo-moar e3a3d2: OUTPUT«/␤»
12:51 gfldex m: $*SPEC.dir-sep.say
12:51 camelia rakudo-moar e3a3d2: OUTPUT«/␤»
12:51 gfldex there you go
12:51 masak m: IO::Spec::Unix.dir-sep.say
12:51 camelia rakudo-moar e3a3d2: OUTPUT«/␤»
12:52 sufrostico joined #perl6
12:52 stevieb m: $*DISTRO.^methods.say
12:52 camelia rakudo-moar e3a3d2: OUTPUT«(BUILD cur-sep Str gist release is-win path-sep name auth version signature desc)␤»
12:52 gfldex there are no spec tests for dir-sep, so consider it an implementation detail
12:54 stevieb a lot of these little tricks are going to significantly lessen the number of lines of code when I port some of my perl5 modules to perl6 :)
12:56 donaldh joined #perl6
13:02 Khisanth joined #perl6
13:03 lizmat joined #perl6
13:06 Woodi joined #perl6
13:13 eroux joined #perl6
13:13 skids joined #perl6
13:16 dalek doc: 5097c4d | (Zoffix Znet)++ | README.md:
13:16 dalek doc: Enumerate third party code in LICENSE
13:16 dalek doc: review: https://github.com/perl6/doc/commit/5097c4d6b9
13:22 dalek perl6.org: 8d84259 | (Zoffix Znet)++ | / (2 files):
13:22 dalek perl6.org: Add legal
13:22 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/8d842590d7
13:22 zakharyas joined #perl6
13:23 Zero_Dogg joined #perl6
13:23 tadzik joined #perl6
13:26 brrt joined #perl6
13:30 dalek modules.perl6.org: e02a997 | (Zoffix Znet)++ | README.md:
13:30 dalek modules.perl6.org: Add legal
13:30 dalek modules.perl6.org: review: https://github.com/perl6/modules.perl6.org/commit/e02a9973bf
13:30 iH2O joined #perl6
13:35 dalek modules.perl6.org: fdaa886 | (Zoffix Znet)++ | README.md:
13:35 dalek modules.perl6.org: Remove duplicate header
13:35 dalek modules.perl6.org: review: https://github.com/perl6/modules.perl6.org/commit/fdaa8862a4
13:36 abruanese joined #perl6
13:38 M-matthew joined #perl6
13:38 M-Illandan joined #perl6
13:44 stevieb joined #perl6
13:46 andreoss joined #perl6
14:01 Sgeo joined #perl6
14:03 stevieb getting my hands dirty by slowly writing a module and tests. upon running a test, I get ``Package Log::Simple already has a method _0...'' at t/000-load.t line 17. _0 is a valid method, but I don't understand how it already exists. My tests are scoped in subtests, and each subtest creates a new object. It's the second subtest that barfs. I've fiddled around and can't sort out what's happening. Could someone, if they have the time,
14:03 stevieb have a quick peek and point out my err? code flow is ``new().generate-log-methods().add-method()''. Code: https://github.com/stevieb9/perl6-log-simple/blob/master/lib/Log/Simple.pm6 Test: https://github.com/stevieb9/perl6-log-simple/blob/master/t/000-load.t
14:04 timotimo you shouldn't add methods in the constructor
14:04 khw joined #perl6
14:04 timotimo they are added to the type, not to the instance
14:05 timotimo so the second time you run new, you'll be re-adding the methods, and correctly get the complaint that the methods are already there
14:05 gfldex unless you test if the method already exists
14:06 gfldex or you move the adding method stuff into a BEGIN block in the module
14:06 timotimo or if you also create a new class every time
14:07 stevieb so, even though the instantiation happens within their own separate scope, the class itself remembers that the new methods have been added?
14:07 timotimo instantiation?
14:07 stevieb sorry, object creation
14:08 gfldex classes are objects, so what object is created?
14:08 timotimo yeah, the methods you're adding are landing in the type object, which only one exists of
14:08 jnthn Objects share a class (well, strictly, a meta-object), and adding a method is an operation on the meta-object.
14:09 jnthn It's nothing to do with scope, really. It's simply that objects don't carry methods, but rather they are of a certain type and that has the methods.
14:09 mst stevieb: adding methods to an object at runtime is rarely a good idea, since you end up adding them to the class
14:09 stevieb oh, ok, now I understand. This is perl5 thinking I believe that's causing me confusion.
14:09 mst in perl5 the usual approach is to rebless yourself into an empty subclass of your 'real' class first
14:09 mst no, this would be completely broken in perl5 too
14:09 mst 'adding methods in BUILD' is one of the most common Moo/Moose antipatterns
14:13 stevieb ok, so instead of the XY problem approach, I'll state what I'm trying to achieve and request feedback on that :) I want to be able to accept a list of names at runtime, and then dynamically add those as methods to a specific object only. Can someone let me know how to approach this, or point me to docs that may exist? or is my thnking all wrong here?
14:13 tailgate joined #perl6
14:14 stevieb ...the existing default dynamic methods should be applied at the class level for all objects, but only once (which I will play with BEGIN to try this)
14:14 gfldex the docs you are asking for will go here: http://doc.perl6.org/language/typesystem
14:14 gfldex (at some point before or after Christmas)
14:14 nine stevieb: that still sounds like a means to achieve a goal rather than the goal itself
14:15 gfldex see: http://design.perl6.org/S12.html#FALLBACK_methods
14:15 nine stevieb: but if you really need that, I'd save those names in an attribute and use FALLBACK
14:15 timotimo actually, i'd go with a very different approach
14:15 nine stevieb: it's like AUTOLOAD in Perl 5
14:15 timotimo why not have it like "use Log::Simple <foo bar baz error warning>"
14:16 stevieb timotimo: yeah, that's a very sane and easy to implement approach
14:16 timotimo yeah, you should try it that way
14:17 timotimo you'd probably create a class inside EXPORT then, like in my ADT module
14:17 stevieb I will take a read of FALLBACK as well. Learning a little every day, and finding I'm liking perl6 quite a lot
14:17 stevieb timotimo: I'll take a look at ADT as well
14:17 timotimo the drawback of FALLBACK is you won't see the methods in .^methods before they have been "tried"
14:17 timotimo whereas with the EXPORT version, you'll be able to properly introspect
14:19 stevieb I like that idea. The way it is now (and how I would have continued trying) states ANON for all the auto-generated methods, so I can't really test to see if they exist with ^methods
14:20 stevieb I appreciate the patence and advice provided here on #perl6
14:23 gfldex m: class L { method log($l, $s) { say "$l, $s" }; method FALLBACK($name, |c) { my $c = $name; self.^add_method($name, method ($s) { log($c, $s) }); self.^compose(); self."$name"(|c) } }; my $log = L.new; $log.log0("foo");
14:23 camelia rakudo-moar e3a3d2: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5log0' (indicated by ⏏)␤  in method <anon> at <tmp> line 1␤  in method FALLBACK at <tmp> line 1␤  in any  at gen/moar/m-Metamodel.nqp line 3055␤  in bl…»
14:24 timotimo i think you have to just return the method in question from FALLBACK and it'll add the method for you automatically
14:24 timotimo has been a while since i last used fallback, though
14:25 abruanese joined #perl6
14:33 iH2O left #perl6
14:35 atweiden joined #perl6
14:36 abruanese joined #perl6
14:41 nine timotimo: no, that's add_fallback. FALLBACK will just be called and is expected to do whatever the called method would have done. There are examples of usage for both ways in Inline::Perl5
14:42 gfldex m: https://gist.github.com/gfldex/51bc1f2d2ec4d5ac3ee27c9530acca4d
14:42 camelia rakudo-moar e3a3d2: OUTPUT«0: foo␤1: bar␤»
14:42 gfldex stevieb: ^^^
14:42 nine m: class Foo { method FALLBACK($name, *@args, *%args) { say $name, @args, %args; }; }; Foo.new.bar(1, 2, :baz<qux>);
14:42 camelia rakudo-moar e3a3d2: OUTPUT«bar[1 2]{baz => qux}␤»
14:43 gfldex stevieb: what you actually want are hygenic macros because ^.compose will make the optimizer unhappy
14:43 nine gfldex: using add_method will again add the method to the class instead of just the object
14:44 gfldex i believe that is intentional
14:44 nine gfldex: to quote stevieb: "and then dynamically add those as methods to a specific object only" http://irclog.perlgeek.de/perl6/2016-06-20#i_12698309
14:45 gfldex given the module he linked earlier I am guessing that his initial stated intention is wrongish
14:46 stevieb gfldex: thanks for that example! I'll have to read up on docs and digest it all.
14:47 cpage_ joined #perl6
14:48 stevieb The original idea was to have all _N() methods added once, and should be available to all objects created. These are the default log methods. then, if desired, a user can send in labels eg: (debug, info etc), and on the object only, map those labels to their corresponding numbered method. I apologize for being as clear as mud
14:49 gfldex stevieb: adding methods at runtime will make it harder for the compiler to help with good error messages/optimisations at compile time
14:50 nine gfldex: ok, just go with timotimo++'s "use Log::Simple <foo bar baz error warning>" approach then :)
14:50 stevieb gfldex: I'm going to just not do that at all, as I definitely don't know enough yet anyhow. I'm just going to trudge along and get the rest of the module working properly before I start looking at doing more trickery :)
14:53 timotimo the compiler can't know anything about methods at compile time anyway; whether you've added methods to an object at run time or not doesn't make a difference to it unless you're using the object before methods are added and afterwards, maybe
14:53 gfldex stevieb: you may find the following helpful https://gfldex.wordpress.com/2016/01/18/a-story-of-export-and-indirection/
14:55 stevieb gfldex: thank you. I was just searching for docs/examples on export, so yes, that's handy
14:55 timotimo writing a class { has $.foo } is equivalent to writing ClassHOW.new_type + adding the attribute + composing the class via the MOP
14:56 timotimo it wouldn't make sense to offer a MOP if it wasn't exactly as powerful as what regular syntax allows you to do
14:59 jjido joined #perl6
15:03 johnjohn101 left #perl6
15:08 abruanese joined #perl6
15:14 ssotka joined #perl6
15:16 adu joined #perl6
15:17 timotimo seeing some livetweets from a perl conference where right now damian conway seems to be talking about perl6
15:17 lizmat yes he is  :-)
15:18 timotimo one POC in the audience is also pointing out the distinct whiteness of the whole audience and speakers
15:18 stmuk_ POC?
15:18 timotimo (but at least someone put LL Cool J on one slide, so that makes 3 POC in total apparently)
15:18 timotimo person of color
15:18 nine timeless: tell that to the creators of other languages with a MOP like Python ;)
15:21 literal ah, I love when this language allows me to eliminate boilerplate. Nice to be able to do "for @a -> (:$foo, :$bar) { ... }" to reference the keys of a hash in each iteration with minimal typing
15:21 BrokenRobot timotimo: last year some sort of JS conf tweeted a photo and it's literally ALL white males :)
15:22 timotimo yeah, it's not uncommon to have white males as the biggest chunk of the audience by far ... :(
15:23 stmuk_ I guess YAPC::Asia didn't have that problem
15:24 timotimo i don't think i'm in a position to make it better, but i'm pretty sure there's some things i'd do without thinking that turns off people from minorities :\
15:24 BrokenRobot Like "POC"? :)
15:24 timotimo hm?
15:25 mst BrokenRobot: um. PoC is, according to most of the internet at this point, the politically correct term to use, and you can expect to be yelled at if you use anything else
15:26 BrokenRobot ¯\_(ツ)_/¯ Just a weird term to use to refer to a human :) OTOH I didn't even know there were races of humans until I was 15 so what do I know
15:26 nine mst: sometimes you just cannot win ;) http://dearblankpleaseblank.com/permalink.php?viewid=216204
15:27 mst bahahahahaha
15:29 nine The whole obsession with skin color is one of the most ridiculous obsessions of the human race (pun very much intended)
15:30 mst :D
15:30 BrokenRobot :)
15:30 timotimo yeah, but we'll not make it better by saying "oh, we're completely color blind here" or ignoring that these people tend to get a lot of BS
15:31 nine of course not :)
15:31 andreoss \part
15:31 andreoss left #perl6
15:32 tony-o one of my favorite parts of the marine corps: http://i.imgur.com/GmUKeRh.jpg
15:32 nine timotimo: btw. considering that 2/3 of humanity are Asian and more than half of humanity is female, speaking of "minorities" may already be part of the problem.
15:32 tony-o relevant to skin color ^
15:33 timotimo the thing about that is that these people don't get viewed by others as part of the global mass of people they would rightfully be a part of
15:33 BrokenRobot Well, maybe the person who pointed out the "distinct whiteness" may offer some ideas on what that is so?
15:33 timotimo it's all local
15:33 * BrokenRobot doesn't even pretend to know the solution to this problem
15:33 mspo what's the gender mix?
15:33 BrokenRobot s/what that/why that/;
15:33 tony-o http://www.unprecedentedmediocrity.com/race-relations-in-the-military-why-america-should-take-notes/
15:33 timotimo you can ask the POC why there aren't more POC in tech, but if you do that, you can very easily seem like a total arsehole
15:34 tony-o mspo: of the population?
15:34 stmuk_ damian is being streamed ...odd I didn't think he liked that
15:34 mspo tony-o: of the conference population
15:34 mst the problem is you need to figure out (1) who might be interested in turning up (2) why the ones who didn't didn't, and if we can do something about that
15:34 timotimo like, even inside an asian country, an asian person can be treated like shit for "being a minority" if they are put into a circle of thirty white doods
15:34 mst and both of those are really tricky
15:35 tony-o timotimo: or even other asians.
15:35 mspo timotimo: or the wrong type of asian
15:35 timotimo that too, yes
15:35 mst right, europe mostly specialises in hating each other for being the wrong sort of white people
15:35 tony-o that seems congruent, people will find a way to discriminate, if not by skin color then by something else
15:35 timotimo even if the race/skin tone/language/... are the same, they could still be gay or trans or atheist or of the wrong religion, or wear the wrong kind of clothes
15:35 timotimo i think i'm going off on a tangent here
15:35 jjido joined #perl6
15:35 tony-o yes :)
15:36 mspo eat the wrong type of bread
15:36 mspo (encountered this in real life)
15:36 timotimo what, really?
15:36 BrokenRobot drink the wrong kind of beer....
15:36 mst use the wrong sort of text editor
15:36 BrokenRobot .. oh wait.. that was in a #perl channel! :P
15:36 timotimo well, yeah, wrong kind of beer that's in cologne and düsseldorf
15:37 tony-o get out mst.
15:37 tony-o :p
15:37 timotimo text editors is pretty funny until you have to explain to an outsider interested in becoming an insider and it's basically another thing they have to learn in order to be accepted
15:38 hoelzro I remember telling one of my sisters that programmers have arguments about which language is best - it blew her mind
15:38 timotimo "oh and btw if someone mentions MongoDB, be sure to point at them and laugh, otherwise you're not with the *in* crowd"
15:38 tony-o timotimo: and vim isn't easy to explain anyway
15:38 timotimo vim isn't easy to explain away :)
15:39 timotimo "nerd culture"/"programmer culture" sometimes feels a bit like the treehouse allegory :|
15:40 profan hoelzro: ahaha, this is one of those things hardest for people outside to understand in my experience
15:41 stmuk_ is everyone watching damian?
15:41 * timotimo finds it easy to complain, hard to measure what's actually pertinent
15:41 timotimo can you give a link to the place where damian can be watched?
15:41 * BrokenRobot is working, so no
15:41 mst http://trout.me.uk/mongodb.jpg
15:41 gfldex stmuk_: i'm not because i'm missing a link
15:41 mspo https://www.youtube.com/watch?annotation_id=5766d9aa-0000-2c32-b623-94eb2c057370&amp;feature=iv&amp;src_vid=HAXGD3JE7pU&amp;v=Nq2HkAYbG5o
15:42 timotimo that's sawyer, though?
15:42 timotimo oh, no, it is actually damian
15:43 stmuk_ no it's sawyers new look
15:43 abruanese joined #perl6
15:43 timotimo :D
15:43 timotimo i hate that it's only on the left ear :(
15:44 hoelzro profan: I think it sheds some light on just how silly it is =)
15:44 mspo timotimo: glad it isn't just me
15:45 timotimo i bet a nice little one-liner for pulseaudio could fix it for me
15:45 profan hoelzro: indeed
15:49 nine Oh would someone give TheDamian a real quantum computer already?
15:51 stmuk_ a hackentosh one?
16:00 dogbert17 o/ #perl6
16:00 BrokenRobot \o
16:00 dogbert17 Hi Zoffix :)
16:01 dogbert17 I have the 'stupid question of the day'
16:01 abruanese joined #perl6
16:01 dogbert17 my $b = bag <bacon eggs>; my $p = $b.pairs; say $p.WHAT; for $p { .say }; for $p { .say } # why can I consume this twice?
16:01 dogbert17 m: my $b = bag <bacon eggs>; my $p = $b.pairs; say $p.WHAT; for $p { .say }; for $p { .say } # why can I consume this twice?
16:01 camelia rakudo-moar e3a3d2: OUTPUT«(Seq)␤(eggs => 1 bacon => 1)␤(eggs => 1 bacon => 1)␤»
16:01 hoelzro m: my $b = bag <bacon eggs>; my $p = $b.pairs; say $p.WHAT
16:01 camelia rakudo-moar e3a3d2: OUTPUT«(Seq)␤»
16:01 hoelzro hmm...good question
16:02 BrokenRobot m: my $b = bag <bacon eggs>; my $p = $b.pairs; say $p.WHAT; for |$p { .say }; for |$p { .say }
16:02 camelia rakudo-moar e3a3d2: OUTPUT«(Seq)␤eggs => 1␤bacon => 1␤This Seq has already been iterated, and its values consumed␤(you might solve this by adding .cache on usages of the Seq, or␤by assigning the Seq into an array)␤  in block <unit> at <tmp> line 1␤␤»
16:03 BrokenRobot bisect: my $b = bag <bacon eggs>; my $p = $b.pairs; say $p.WHAT; for $p { .say }; for $p { .say }
16:03 bisectable BrokenRobot: on both starting points the exit code is 0 and the output is identical as well
16:06 BrokenRobot m: my $b = bag <bacon eggs>; my $p = $b.pairs; say $p.WHAT; for $p { .WHAT.say }; for $p { .WHAT.say }
16:06 camelia rakudo-moar e3a3d2: OUTPUT«(Seq)␤(Seq)␤(Seq)␤»
16:06 nine Listening to TheDamian's great message, I still can't help but think, despite all it's greatness - and this will ultimately lead to a Perl 7 - Perl 6 still does not exactly do what I mean, it still does what I say. So I guess Perl 7 will have to be built on top of an epic AI core.
16:07 BrokenRobot dogbert17: I'm no expert, but it looks like in this case for just passes a singular seq inside the loop instead of iterating over each pair
16:08 BrokenRobot .oO( lizmat sure naps a lot.... lucky )
16:11 dogbert17 BrokenRobot: I agree but shouldn't it iterate of the pairs?
16:11 hoelzro hmm...is it that the seq's iterator will iterate until IterationEnd, and then set itself up in a state as if it were iterating from the beginning again, instead of setting itself up to just keep returning IterationEnd?
16:12 huggable joined #perl6
16:12 gfldex https://github.com/rakudo/rakudo/blob/nom/src/core/Baggy.pm#L154
16:13 hoelzro oh, I think I understand
16:13 hoelzro m: my $b = bag <bacon eggs>; my $p = $b.pairs; say $p.WHAT; for $p { .say }; for $p { .say } # why can I consume this twice?
16:13 camelia rakudo-moar a22316: OUTPUT«(Seq)␤(eggs => 1 bacon => 1)␤(eggs => 1 bacon => 1)␤»
16:13 hoelzro m: my $b = bag <bacon eggs>; my $p = $b.pairs; say $p.WHAT; for @($p) { .say }; for @($p) { .say } # why can I consume this twice?
16:13 camelia rakudo-moar a22316: OUTPUT«(Seq)␤eggs => 1␤bacon => 1␤eggs => 1␤bacon => 1␤»
16:13 hoelzro hmm, maybe not
16:14 hoelzro I figured that it was basically calling $p.say twice, and Seq.gist is impl'd as self.cache.gist
16:14 dogbert17 gfldex: have looked at the code but can't say it has made me wiser :(
16:14 hoelzro m: my $b = bag <bacon eggs>; my $p = $b.pairs; say $p.WHAT; for @($p) { say "$_ {$++}" }; for @($p) { "$_ {$++}" } # why can I consume this twice?
16:14 camelia rakudo-moar a22316: OUTPUT«WARNINGS for <tmp>:␤Useless use of "$_ {$++}" in expression "$_ {$++}" in sink context (line 1)␤(Seq)␤eggs   1 0␤bacon       1 1␤»
16:15 hoelzro m: my $b = bag <bacon eggs>; my $p = $b.pairs; say $p.WHAT; for @($p) { say "$_ {$++}" }; for @($p) { say "$_ {$++}" }
16:15 camelia rakudo-moar a22316: OUTPUT«(Seq)␤eggs   1 0␤bacon       1 1␤eggs        1 0␤bacon       1 1␤»
16:15 BrokenRobot hoelzro: that makes a list
16:15 BrokenRobot Isn't that a way to make a Seq consumable more than once?
16:15 hoelzro @($p)? right, but that should drain the iterator
16:15 cdg joined #perl6
16:15 hoelzro if you assign the result of @($p), yes
16:15 BrokenRobot Ah
16:15 hoelzro it doesn't cache the results, afaik
16:16 eugen joined #perl6
16:16 hoelzro Seq is a weak spot for me in Perl 6, thought, so I could be wrong
16:17 gfldex the iterator is created of %!elems of the bag
16:17 gfldex that hash is persistent
16:19 gfldex also there is Set::cache what means that Sets can be consumed but don't have to
16:21 dogbert17 gfldex: does that mean that the contents, if that's the correct wording, decides wheather a Seq is consumed or not?
16:21 * dogbert17 clearly confused
16:21 gfldex the content or you
16:22 gfldex by calling .cache you can make it's values persistent if you call that method befor iteration
16:22 dogbert17 gfldex: but that is not necessary in this particular case?
16:24 dogbert17 could some amendments in https://doc.perl6.org/type/Seq be in order?
16:26 gfldex "However, calling .cache on a Seq will return a List that is still lazy, but stores the generated values for later access."
16:27 gfldex m: my @a = lines; @a.WHAT.say; @a.say;
16:27 camelia rakudo-moar a22316: OUTPUT«(Array)␤[Céad slán ag sléibhte maorga Chontae Dhún na nGall Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll; Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí I mo dhiaidh bhí gleanntáin ghlas…»
16:28 dogbert17 gfldex: I didn't see any call to .cache in Baggy.pm though
16:28 gfldex nor do you need that
16:29 dogbert17 obvoisly not :) I need to wrap my brain around this it seems
16:29 gfldex if you want to iterate over a listy thing twice you assign it to a @-sigiled container and it will be maintained
16:30 dogbert17 I'm with you so far :)
16:33 gfldex m: for lines { .say }; for lines { .say };
16:33 camelia rakudo-moar a22316: OUTPUT«5===SORRY!5===␤Function 'lines' needs parens to avoid gobbling block␤at <tmp>:1␤------> 3for lines { .say }7⏏5; for lines { .say };␤Missing block (apparently claimed by 'lines')␤at <tmp>:1␤------> 3for lines { .say }7⏏5; for line…»
16:33 gfldex m: for lines() { .say }; for lines() { .say };
16:33 camelia rakudo-moar a22316: OUTPUT«Céad slán ag sléibhte maorga Chontae Dhún na nGall␤Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bhí gleanntáin ghlas’ G…»
16:33 gfldex old example is old
16:34 gfldex m: my @a = 1,2,3; my @b = <a b c>; my \c = @a Z=> @b; .say for c; .say for c;
16:34 camelia rakudo-moar a22316: OUTPUT«1 => a␤2 => b␤3 => c␤This Seq has already been iterated, and its values consumed␤(you might solve this by adding .cache on usages of the Seq, or␤by assigning the Seq into an array)␤  in block <unit> at <tmp> line 1␤␤»
16:35 cur8or joined #perl6
16:37 dogbert17 ok, just to add to my stupidity, what does \c do?
16:38 AlexDaniel joined #perl6
16:39 BrokenRobot dogbert17: containerless var
16:39 BrokenRobot well.. not really a "var" more like a constant, since you can't change it
16:39 AlexDaniel er, do we have any docs for that?
16:39 BrokenRobot m: my \Δ = 'meow'; say Δ
16:39 camelia rakudo-moar a22316: OUTPUT«meow␤»
16:39 BrokenRobot m: my \Δ = 'meow'; Δ  = 5
16:39 camelia rakudo-moar a22316: OUTPUT«Cannot modify an immutable Str␤  in block <unit> at <tmp> line 1␤␤»
16:40 AlexDaniel m: my \pi = 3; say pi # ouch
16:40 camelia rakudo-moar a22316: OUTPUT«3␤»
16:40 dogbert17 BrokenRobot: many thanks
16:40 gfldex m: my Int $a; my \b := $a; b = 10; dd $a, b;
16:40 camelia rakudo-moar a22316: OUTPUT«Int $a = 10␤Int $a = 10␤»
16:41 gfldex it's very variable
16:41 gfldex m: my Int $a; my \b = $a; b = 10; dd $a, b;
16:41 camelia rakudo-moar a22316: OUTPUT«Int $a = 10␤Int $a = 10␤»
16:41 gfldex and an implicit binding
16:41 BrokenRobot neat. gfldex++
16:41 AlexDaniel cool, what about docs?
16:42 AlexDaniel ah
16:42 AlexDaniel here
16:42 AlexDaniel http://doc.perl6.org/language/variables#Sigilless_variables
16:42 AlexDaniel containerless sigilless variables!
16:42 gfldex also http://doc.perl6.org/language/containers#Binding
16:43 BrokenRobot That section isn't too descriptive for someone who doesn't know wtf "lexpad" is :/
16:43 gfldex sigilless variables will never introduce a _new_ container
16:43 dogbert17 gfldex: nice, it seems I have some reading to do
16:44 BrokenRobot Ah, OK. There's a sentence at the start of the page "At run time, a variable appears as an entry in a lexical pad, or lexpad for short. This is a per-scope data structure that stores a pointer for each variable."
16:46 BrokenRobot m: my Int $a; my \b = $a; b = 10; dd $a, b; my $z = 42; b = $z; dd $a, $z, b
16:46 camelia rakudo-moar a22316: OUTPUT«Int $a = 10␤Int $a = 10␤Int $a = 42␤Int $z = 42␤Int $a = 42␤»
16:46 BrokenRobot trippy
16:47 BrokenRobot oh, it just uses the value the second time. Never mind :)
16:47 gfldex m: my \b = 42; b = 43;
16:47 camelia rakudo-moar a22316: OUTPUT«Cannot modify an immutable Int␤  in block <unit> at <tmp> line 1␤␤»
16:48 gfldex literals don't come with buildin containers. Binding to a literal will not create a container. Literals are constant.
16:49 gfldex therefore calling sigilless variables, sigilless variables is a bit missleading
17:01 tbrowder [Coke]: I made it different because the order seems to be more desirable IMHO, and it can be done by the file name and the correct sort (htmlify.p6 was modded by me to do that for the Programs dir  and tab)
17:03 eroux joined #perl6
17:04 tony-o m: my \b = $(42); b = 43; b.say;
17:04 camelia rakudo-moar a22316: OUTPUT«Cannot modify an immutable Int␤  in block <unit> at <tmp> line 1␤␤»
17:04 tony-o m: my $x = 42; my \b = $x; b = 43; b.say;
17:04 camelia rakudo-moar a22316: OUTPUT«43␤»
17:05 tony-o m: my \b = (my $x = 42); b = 43; b.say;
17:05 camelia rakudo-moar a22316: OUTPUT«43␤»
17:06 dalek doc: 5ac6d7b | (Zoffix Znet)++ | doc/Programs/01-debugging.pod:
17:06 dalek doc: Link to repos
17:06 dalek doc: review: https://github.com/perl6/doc/commit/5ac6d7b4a1
17:07 BrokenRobot m: my \b = $ = 42; b = 43; b.say;
17:07 camelia rakudo-moar a22316: OUTPUT«43␤»
17:12 kurahaupo joined #perl6
17:16 pierrot joined #perl6
17:24 sena_kun joined #perl6
17:25 rgrinberg joined #perl6
17:28 sena_kun m: my Int $num = 3; "abcc" ~~ /"ab" 'c' ** 1..$num/;
17:28 camelia rakudo-moar a22316: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed Range␤at <tmp>:1␤------> 3Int $num = 3; "abcc" ~~ /"ab" 'c' ** 1..7⏏5$num/;␤»
17:28 pmichaud good afternoon, #perl6
17:28 sena_kun Documentation is a bit obscure about interpolation of variables into regexes(if it's not another regex). Is it possible at all?
17:29 BrokenRobot m: my Int $num = 3; say "abcc" ~~ /"ab" 'c' ** {1..$num}/;
17:29 camelia rakudo-moar a22316: OUTPUT«「abcc」␤»
17:29 sena_kun BrokenRobot, ouch. Thanks a lot.
17:30 BrokenRobot sena_kun: seems wrong actually
17:30 BrokenRobot m: my Int $num = 3; say "abccccccccccc" ~~ /"ab" 'c' ** {5..$num}/;
17:30 camelia rakudo-moar a22316: OUTPUT«Nil␤»
17:30 BrokenRobot Oh, num is 3
17:30 sena_kun BrokenRobot, trying it in actual regex now...
17:30 BrokenRobot m: my Int $num = 3000; say "abccccccccccc" ~~ /"ab" 'c' ** {5..$num}/;
17:30 camelia rakudo-moar a22316: OUTPUT«「abccccccccccc」␤»
17:31 BrokenRobot never mind :P
17:33 pmichaud I believe that variables in range quantifiers is NYI in rakudo.
17:33 dalek doc: ffb9ce7 | (Wenzel P. P. Peppmeyer)++ | doc/ (2 files):
17:33 dalek doc: update example and error message
17:33 dalek doc: review: https://github.com/perl6/doc/commit/ffb9ce74f8
17:33 jnthn It...just worked in the example above? :)
17:33 pmichaud oh, I could be wrong about that.  :)
17:34 pmichaud m: my $num = 7;  say "abcccccccccccccccc" ~~ / "ab" 'c' ** (5..$num)/;
17:34 camelia rakudo-moar a22316: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Quantifier quantifies nothing␤at <tmp>:1␤------> 3ay "abcccccccccccccccc" ~~ / "ab" 'c' **7⏏5 (5..$num)/;␤»
17:34 setty1 joined #perl6
17:34 firstdayonthejob joined #perl6
17:34 pmichaud m: my $num = 7;  say "abcccccccccccccccc" ~~ / "ab" 'c' ** {5..$num}/;
17:34 camelia rakudo-moar a22316: OUTPUT«「abccccccc」␤»
17:34 pmichaud okay, it works.
17:35 diakopter istr working on that
17:35 diakopter maybe not though!
17:36 lizmat joined #perl6
17:37 diakopter er no, I didn't do that particular thing
17:39 _28_ria joined #perl6
17:39 buharin joined #perl6
17:42 jnthn I think it was FROGGS++ :)
17:43 kid51 joined #perl6
17:46 abruanese joined #perl6
17:53 spider-mario joined #perl6
17:59 vendethiel joined #perl6
17:59 fhorck joined #perl6
18:00 kid511 joined #perl6
18:01 lmmx joined #perl6
18:01 domidumont joined #perl6
18:12 eugen joined #perl6
18:15 sno joined #perl6
18:15 ocbtec joined #perl6
18:18 mspo any more p6 talks streaming today?
18:19 * [Coke] waves at pmichaud
18:19 * pmichaud waves to [Coke]
18:19 pmichaud there's two more p6 talks today, I think
18:21 pmichaud switching rooms
18:22 vendethiel is it YAPC::NA time?
18:24 moritz it is
18:25 pmichaud about to start:  "Perl 6 and the Zen of Erlang"  http://www.yapcna.org/yn2016/talk/6600
18:25 pmichaud afterwards:  "Perl 6 - Why did they do *that*?"  http://www.yapcna.org/yn2016/talk/6645
18:26 cpage_ joined #perl6
18:26 pmichaud I don't know if they're streaming.
18:28 DrForr_ Just the keynotes are streaming.
18:29 FROGGS joined #perl6
18:32 perigrin They should be posted quickly, we've been *promised* quickly posted.
18:36 timotimo wow, you mean those promises are going to actually be kept?
18:38 Woodi thanx YAPC for Damian video! but wondering do I need to pay now ? :)
18:46 BrokenRobot You could pitch in to TPM for funding his Toronto talks next week (and yes, both will be recorded): https://www.gofundme.com/damian_conway
18:47 tony-o timotimo: what ever happened with the servers that were donated ~2 years ago, are those still running the perl6 docs/sites ?
18:47 BrokenRobot One: http://www.meetup.com/Toronto-Perl-Mongers/events/231418224/  and the other: http://www.meetup.com/Toronto-Perl-Mongers/events/231418278/
18:48 timotimo tony-o: that's what runs p6c.org
18:48 dha joined #perl6
18:48 timotimo i hadn't realized that's already 2 years old
18:51 tony-o it may be less, i have so much old code lying around it's difficult to put a timeline on anything in p6
18:53 yanmc what's preferred in a shebang, perl with `use 6.c' or just perl6?
18:54 dogbert17 is gfldex still around?
18:54 mst perl6 with 'use 6.c'
18:55 tony-o yanmc: i use 'perl6'
18:56 [Coke] perl with use 6.c  -- won't work.
18:56 mst right
18:56 mst perl6 in the shebang, but 'use 6.c' is still a good thing
18:56 [Coke] perl6 -- will eventually have issues when the next spec is released.
18:56 [Coke] mst is correct.
18:56 yanmc got it, thanks guys
18:59 dogbert17 I have tried to write some docs for method pairs in Baggy, is it ok? gist: https://gist.github.com/dogbert17/efcb4849920629c281f0b8942b42fbf3
19:07 eroux joined #perl6
19:08 moritz dogbert17: "the weight that element.
19:08 moritz "
19:08 moritz the weight *of* that element
19:08 moritz otherwise, good
19:08 dogbert17 moritz: oops, will fix ...
19:09 moritz maybe you want to add an example with a weight != 1
19:09 dogbert17 moritz: will do
19:09 moritz m: say bag(<bacon egg bacon>).pairs.sort
19:09 camelia rakudo-moar 0e10f4: OUTPUT«(bacon => 2 egg => 1)␤»
19:09 dogbert17 I'll steal it :)
19:10 moritz well, I mostly stole it from you in the first place :-)
19:10 dogbert17 :-)
19:11 Emeric1 joined #perl6
19:13 dalek doc: 74757ad | (Jan-Olof Hendig)++ | doc/Type/Baggy.pod:
19:13 dalek doc: Added docs for method 'pairs' in Baggy. moritz++
19:13 dalek doc: review: https://github.com/perl6/doc/commit/74757ad1c9
19:13 girafe joined #perl6
19:16 * dogbert17 method 'pairs' in Baggy sounded better than Baggy.pairs methinks
19:17 lizmat .oO( good thing we don't have a "pants" method )
19:17 moritz I'm sure TimToady will find a good rationale for including one
19:17 moritz :-)
19:17 * [Coke] was happy to hear the liz/wendy shoutout in the keynote *kermit arm flail8
19:18 [Coke] m: Cat.new:pants
19:18 camelia rakudo-moar 8ad19e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤    Cat used at line 1. Did you mean 'Rat'?␤␤»
19:18 moritz m: ::Cat.new:pants
19:18 camelia rakudo-moar 8ad19e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤No such symbol 'Cat'␤at <tmp>:1␤------> 3::Cat7⏏5.new:pants␤»
19:19 Xliff .tell FROGGS I've submitted the PR. Hope to hear from you soon.
19:19 yoleaux Xliff: I'll pass your message to FROGGS.
19:20 dogbert17 lizmat: how is YAPC?
19:25 addison joined #perl6
19:25 lizmat dogbert17: it's cool with a lot of Perl 6  :-)
19:31 Xliff Are there going to be slide?
19:31 Xliff Please tell me there will be slides.
19:31 Xliff For us unlucky people who were unable to attend.
19:31 lizmat I understand there'll be at least videos
19:32 Xliff Ooh! bag =:= histogram?
19:33 moritz yes
19:33 Xliff [Coke], liz/wendy?
19:33 Xliff Lisa and Wendy?
19:33 lizmat Liz
19:33 Xliff kk... not who I am thinking of, then.
19:33 lizmat no royalty involved
19:34 Xliff lizmat++
19:34 Xliff Dude, I still can't believe he's gone.
19:34 dogbert17 lizmat: sounds nice
19:34 dogbert17 Prince?
19:34 Xliff dogbert17, Yes.
19:34 moritz Xliff: if you've ever mit lizmat and wendy, you won't forget :-)
19:34 moritz *met
19:34 Xliff LOL!
19:35 Xliff moritz, I bet
19:35 Xliff So...YAPC videos... I will search for them later.
19:40 raiph joined #perl6
19:40 cdg joined #perl6
19:45 raiph can lizmat or anyone else advise on who to contact re https://www.reddit.com/r/perl/comments/4oynpb/yapcna_morning_stream/d4h1f71 ?
19:46 lizmat please report on the #yapc channel on irc.perl.org and mention it to e.g. genehack
19:48 BrokenRobot raiph: BTW, I saw some commits go into Rakudo, but they were credited to just `raiph` in the release log. If in the future you want to be credited by some other name, please submit a PR adding yourself to https://github.com/rakudo/rakudo/blob/nom/CREDITS
19:48 raiph lizmat: thanks
19:49 raiph BrokenRobot: thanks
19:50 perlpilot_tpc BrokenRobot++  (I don't know entirely why, but I find it important that people be credited the way they want to be)
19:53 dogbert17 moritz: is it ok if I trouble you with one more doc gist?
19:58 japhb joined #perl6
19:58 jjido joined #perl6
20:04 dalek doc: c6e9981 | (Jan-Olof Hendig)++ | doc/Type/Baggy.pod:
20:04 dalek doc: Added docs for Baggy.antipairs
20:04 dalek doc: review: https://github.com/perl6/doc/commit/c6e99813a3
20:05 moritz dogbert17: sure
20:08 pomJ joined #perl6
20:08 pomJ left #perl6
20:10 dogbert17 moritz: I jumped the gun and committed just above your reply, sorry :(
20:11 Emeric1 joined #perl6
20:11 moritz dogbert17: I'm fine with that
20:11 moritz dogbert17: you're free to commit without any sort of pre-review :-)
20:11 perlpilot_tpc dogbert17: forgiveness >>> permission
20:12 huggable joined #perl6
20:12 moritz m: say bag(<eggs bacon>).antipairs
20:12 camelia rakudo-moar 8ad19e: OUTPUT«(1 => bacon 1 => eggs)␤»
20:12 moritz dogbert17: in that example, the 2 is a bit of a mistery
20:13 dogbert17 moritz: not only that, I seem to have destroyed the page although I don't know how
20:14 dogbert17 see https://doc.perl6.org/type/Baggy
20:15 dogbert17 how on earth did my commit manage to do that, hmm
20:15 yanmc m: my @t = 1, 3; say $@t
20:15 camelia rakudo-moar 8ad19e: OUTPUT«[1 3]␤»
20:16 yanmc the double sigil, isn't that how to get the length of a list?
20:16 moritz http://doc.perl6.org/build-log/build-2016-06-20T20:05+0000.log says
20:16 moritz Use of uninitialized value $source-name of type Any in string context
20:16 moritz Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed.  in sub extract-pod at ./htmlify.p6 line 189
20:16 moritz Baggy does not have an =SUBTITLE
20:16 moritz oh, sorry for spamming
20:16 moritz yanmc: no, that's perl 5 thinking
20:16 perlpilot_tpc m: my @t = 1, 3; say +@t;
20:16 camelia rakudo-moar 8ad19e: OUTPUT«2␤»
20:16 moritz yanmc: @t.elems or +@t
20:17 moritz yanmc: scalar context doesn't lose information as in p5
20:19 dogbert17 moritz: strange, I can see it in the document, running htmlify now
20:19 moritz dogbert17: agreed, something is triggering a strage corner case in htmlify
20:19 yanmc hmm, thanks, I don't know that much about p5 though
20:19 cdg joined #perl6
20:20 yanmc so it automatically does the right thing, as in
20:20 yanmc m: my @t = 1, 3; say ([+] @t) / @t
20:20 camelia rakudo-moar 8ad19e: OUTPUT«2␤»
20:20 dogbert17 moritz: on this page, https://doc.perl6.org/type.html, role is suddenly written twice
20:20 moritz yanmc: yes, that's numeric context
20:20 moritz dogbert17: "huh"
20:22 dogbert17 role, role  Baggy  Collection of distinct weighted objects
20:22 moritz dogbert17: did you happen to check the HTML before that commit?
20:23 dogbert17 moritz: no :( but I should have. oO(the changes looked so innocent)
20:24 moritz no, that's fine, something in the tooling is brittle
20:24 dogbert17 moritz: I'll try to figure it out
20:24 dalek doc: ebb259c | moritz++ | doc/Type/Baggy.pod:
20:24 dalek doc: Stylistic improvements to Baggy.pod
20:24 dalek doc: review: https://github.com/perl6/doc/commit/ebb259c561
20:24 [Coke] first step - see if baggy looks ok in the previous version: if so, revert until we sort it out
20:25 [Coke] ... unless we're piling more on it. nevermind. I leave to y'all
20:25 [Coke] leave *it
20:26 moritz the role, role thingy kinda makes me think it tries to register role Baggy twice
20:26 moritz and the second one overrides the first, which leads to the methods all going missing
20:26 moritz ... or something like that
20:27 yanmc in $t.^name is the carret part of the (method?) name or is it some kind of operator
20:28 moritz yanmc: it's part of the method call operator, and here means "call the method on meta object"
20:29 moritz $t.^name is short for $t.HOW.name($t)
20:30 dogbert17 moritz: I ran htmlify on my machine and it worked, the only change I had done was to add some bacon in the example
20:30 moritz dogbert17: commit it!
20:31 dogbert17 will do
20:31 mohae_ joined #perl6
20:31 moritz and I should install a newer perl6 on the server that builds the docs
20:31 kid51 joined #perl6
20:32 moritz oh, the methods are back on http://doc.perl6.org/type/Baggy
20:32 TEttinger joined #perl6
20:32 cur8or joined #perl6
20:34 moritz cosmic rays, probably
20:34 dogbert17 moritz: strange indeed
20:35 dogbert17 I now have a merge commit in my repo, how do I get rid of that
20:36 dogbert17 or shoul I leave it ...
20:36 dogbert17 s/shoul/should/
20:38 jjido joined #perl6
20:39 dalek doc: 4678149 | (Jan-Olof Hendig)++ | doc/Type/Baggy.pod:
20:39 dalek doc: Fixed broken code example. moritz++
20:39 dalek doc: review: https://github.com/perl6/doc/commit/4678149683
20:40 cur8or joined #perl6
20:41 dogbert17 hopefully the methods will stay in place :)
20:42 dogbert17 there's something fishy with class Grammar as well
20:42 dogbert17 class, class  Grammar  Group of named regexes that form a formal grammar
20:45 moritz something's fishy in the state of 6mark
20:49 Raj_ joined #perl6
20:52 masak question: how do you parse with a grammar, but allow it to match a prefix of the string you pass in?
20:52 dwarring joined #perl6
20:53 masak that is, I'm fine with the implicit ^ anchor it puts in, but I want it to ignore the implicit $ anchor
20:53 moritz masak: .subparse?
20:53 masak that seems to do it -- thanks, moritz++
20:54 moritz masak: as shocking as it might seem, we actually have API docs for class Grammar :-)
20:54 masak moritz: I'm still getting used to that idea
20:54 moritz (not that I mind such questions)
20:54 masak though truth be told, it was very likely quicker to ask here, thanks to you :P
20:54 perlpilot_tpc moritz: So ....  I type "p6doc XXX"  what's XXX?   ;)
20:55 moritz perlpilot_tpc: you open http://doc.perl6.org/type/Grammar and the TOC already enlightens you :-)
21:02 * masak .oO( .subtweet )
21:14 dha joined #perl6
21:20 masak is there a way to ask a failed match how far it managed to match before it started backtracking and failing?
21:21 dogbert17 class QuantHash does Associative { }     should this be    role QuantHash does Associative { }
21:24 jjido joined #perl6
21:25 atweiden joined #perl6
21:26 chris2 joined #perl6
21:31 lizmat masak: wasn't there something with a local FAILGOAL ?
21:33 ShimmerFairy joined #perl6
21:33 masak lizmat: that does sound familiar
21:36 pmichaud sounds like "high water mark"
21:37 timotimo ohai pmichaud!
21:37 pmichaud timotimo: o/
21:37 timotimo can we talk about updating wordpress on rakudo.org some time soon-ish?
21:37 ShimmerFairy \o
21:38 timotimo mostly needs someone who can make a full backup before and perhaps a full restore after someone clicks the "install update" button
21:38 pmichaud timotimo: moritz++ already asked me about it.  I'll take care of it Wednesday or Thursday, when I'm done with my YAPC::NA stuff
21:38 timotimo oh, cool!
21:38 timotimo thanks :)
21:38 timotimo heyo ShimmerFairy
21:38 timotimo i haven't actually looked into supernova since last we talked :<
21:38 arnsholt masak: That definitely sounds like the high water mark. Sadly I never could figure out quite how that works
21:38 pmichaud (I have a variety of things that have to happen for all of the domains on that server, so will also be working on that over the next few weeks.)
21:39 Zoffix pmichaud, https would be cool too :) https://rt.perl.org/Ticket/Display.html?id=128423
21:39 Zoffix Quick, everyone! Give pmichaud more jobs! :P
21:39 ShimmerFairy timotimo: atm I'm working on a grammar for C++, so I've not thought about it much either :P . (I'm glad it's easy to pull in HLL::Grammar now though.)
21:39 pmichaud Zoffix: yes, I saw that ticket also.  Fixing https may be more of a challenge.  I've looked into setting up a certificate before and it didn't quite make sense to me.
21:39 yanmc m: $t=1..3; for ^3 Z $t -> $a, $b { say "$a -- $b" }
21:39 camelia rakudo-moar ee663c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$t' is not declared␤at <tmp>:1␤------> 3<BOL>7⏏5$t=1..3; for ^3 Z $t -> $a, $b { say "$a␤»
21:40 yanmc it fails anyway, but I'd expect the same output as
21:40 Zoffix pmichaud, oh :( I'd offer to help, but I'm clueless myself.
21:40 ShimmerFairy pmichaud: don't remember what it was called, but there was some kind of effort set up a while back (supported by Mozilla IIRC) to make it easy & free to HTTPS-ify a site.
21:40 Zoffix yanmc, you need 'my' before $t
21:40 yanmc m: my $t=1..3; for $t.kv -> $a, $b { say "$a -- $b" }
21:40 camelia rakudo-moar ee663c: OUTPUT«0 -- 1␤1 -- 2␤2 -- 3␤»
21:40 yanmc Zoffix: I know, I copy/pasted from the REPL and forgot to add it
21:40 Zero_Dogg joined #perl6
21:40 pmichaud in a larger sense I have to figure out what to do with that server in general.  It's running CentOS 5 which is being end-of-lifed, and IIUC I have to migrate everything to a new server (there's no in-place upgrade option)
21:41 pmichaud so I'm re-evaluating the whole service proposition.  :)
21:41 pmichaud anyway, it's on my list, and after this week I'll even have tuits
21:42 dj_goku the SSL cert is for host.pmichaud.com and not *.rakudo.org
21:42 dalek doc: a80a093 | (Jan-Olof Hendig)++ | doc/Type/ (2 files):
21:42 dalek doc: Iterable and QuantHash are roles
21:42 dalek doc: review: https://github.com/perl6/doc/commit/a80a093df4
21:42 daxim joined #perl6
21:42 masak jnthn++'s grammar-tracer++ to the rescue in the end. shoulda used it sooner.
21:43 masak also, I ought to write a small script which just clones the grammar-debugger and Terminal-ANSIColor repositories straight into wherever I'm writing code, setting up the paths for me :)
21:43 masak and another script that cleans up afterwards
21:44 Zoffix m: my $t=1..3; for <0 1 2 1 2 3> -> $a, $b { say "$a -- $b" }
21:44 camelia rakudo-moar ee663c: OUTPUT«0 -- 1␤2 -- 1␤2 -- 3␤»
21:44 Zoffix m: my $t=1..3; for |(|^3 Z |$t) -> $a, $b { say "$a -- $b" }
21:44 camelia rakudo-moar ee663c: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
21:44 Zoffix Why doesn't the second one work?
21:44 Zoffix m: my $t=1..3; say |(|^3 Z |$t)
21:44 camelia rakudo-moar ee663c: OUTPUT«(0 1 2 1 2 3)␤»
21:44 yanmc try it with 1..4
21:44 * DrForr_ destresses.
21:44 ShimmerFairy masak: if only there was some kind of modular system to do all this for you... :P
21:45 yanmc somehow it zips in the wrong direction? hard to explain
21:45 Zoffix yanmc, zips fine to me
21:45 masak m: my $t=1..3; for |(|^3 Z |$t) -> ($a, $b) { say "$a -- $b" }
21:45 camelia rakudo-moar ee663c: OUTPUT«Too many positionals passed; expected 2 arguments but got 6 in sub-signature␤  in block <unit> at <tmp> line 1␤␤»
21:45 Zoffix Oh
21:45 masak m: my @t = 1..3; for ^3 Z @t -> ($a, $b) { say "$a -- $b" }
21:46 camelia rakudo-moar ee663c: OUTPUT«0 -- 1␤1 -- 2␤2 -- 3␤»
21:46 masak there ya go
21:46 Zoffix yanmc, good catch
21:46 yanmc masak: ah, took me a while to see the change :)
21:46 pmichaud DrForr:  suggestion:  for ^@a.elems -> $key { ... }   might be more canonically written as    for @a.keys -> $key { ... }
21:46 Zoffix masak, but how come the slips didn't work? :) And how come |(|^3 Z |$t) zips the middle two elements backwards?
21:47 Zoffix m: my @t = 1..3; my $t = 1..3; say ^3 Z @t; say |(|^3 Z |$t);
21:47 camelia rakudo-moar ee663c: OUTPUT«((0 1) (1 2) (2 3))␤(0 1 2 1 2 3)␤»
21:48 yanmc I did pick bad numbers; to not go crazy, don't use the same set of numbers in the two lists ;-)
21:48 DrForr_ Thanks. I'll probably use this later on, good to know.
21:49 Zoffix m: my @t = 1..3; my $t = 6..9; say ^3 Z @t; say (|(^3) Z |($t));
21:49 camelia rakudo-moar ee663c: OUTPUT«((0 1) (1 2) (2 3))␤((0 1 2 6 7 8 9))␤»
21:49 Zoffix Still messed up
21:50 Zoffix m: my @t = 1..3; my $t = 6..9; say ^3 Z @t; say @^3 Z @$t;
21:50 camelia rakudo-moar ee663c: OUTPUT«((0 1) (1 2) (2 3))␤((one(Mu.new, 3) 6) (one(Mu.new, Mu.new) 7) (one(Mu.new, Mu.new) 8) (one(Mu.new, Mu.new) 9))␤»
21:50 Zoffix m: my @t = 1..3; my $t = 6..9; say ^3 Z @t; say @(^3) Z @$t;
21:50 camelia rakudo-moar ee663c: OUTPUT«((0 1) (1 2) (2 3))␤((0 6) (1 7) (2 8))␤»
21:50 Zoffix K, I think I get it
21:51 Zoffix m: &infix:<Z>.candidates.say
21:51 camelia rakudo-moar ee663c: OUTPUT«(sub infix:<Z> (+ is raw, :$with!) { #`(Sub|39599664) ... } sub infix:<Z> (+ is raw) { #`(Sub|39599816) ... })␤»
21:51 masak ShimmerFairy: if I didn't know better, I'd think you were sarcastic or sump'n ;)
21:52 masak Zoffix: I have no idea, I just do it that way with the parens
21:54 Zoffix masak, in the broken version it zips up just the last element of the first list and the first element of the second list. It needs single things on LHS/RHS not lists.
21:58 masak if you say so
21:59 masak tonight's hard lesson: ordering between rules in a proto rule really matters
22:03 sortiz joined #perl6
22:03 sortiz \o #perl6
22:03 Zoffix \o
22:04 sortiz Zoffix++ # #100
22:04 Zoffix \o/
22:06 lizmat socializing&
22:12 brabo left #perl6
22:16 Zoffix m: grammar Foo { token TOP { <digit>+ }; token digit:sym<sign> { <[+-]> }; token digit:<num> { \d } }; say Foo.parse: '+20';
22:16 camelia rakudo-moar ee663c: OUTPUT«Nil␤»
22:16 Zoffix What is this :sym<> stuff on tokens? What does it do?
22:18 AlexDaniel joined #perl6
22:21 Zoffix m: grammar Foo { token TOP { <digit>+ }; proto token digit {*}; token digit:sym<sign> { $<sign> = <[+-]> }; token digit:sym<num> { $<num> = \d+ } }; say Foo.parse: '+20';
22:21 camelia rakudo-moar ee663c: OUTPUT«「+20」␤ digit => 「+」␤  sign => 「+」␤ digit => 「20」␤  num => 「20」␤»
22:22 Zoffix k
22:23 Emeric joined #perl6
22:23 masak 'night, #perl6
22:24 Zoffix night
22:24 sortiz night masak
22:24 skids joined #perl6
22:37 raiph m: grammar g { rule TOP { alternative1 | alternative2 } }; say g.parse("alternative2")
22:37 camelia rakudo-moar ee663c: OUTPUT«「alternative2」␤»
22:37 raiph m: grammar g { proto rule TOP { * }; rule TOP:sym<this> { alternative1 }; rule TOP:sym<that> { alternative2 } }; say g.parse("alternative2")
22:37 camelia rakudo-moar ee663c: OUTPUT«「alternative2」␤»
22:37 raiph ^^Zoffix I think these are equivalent
22:38 raiph (well, forget the proto'ing of TOP that's irrelevant)
22:44 Zoffix raiph, is there a way to get the name inside of :sym<> tho?
22:44 Zoffix m: grammar Foo { token TOP { <digit>+ }; proto token digit {*}; token digit:sym<sign> { <[+-]> }; token digit:sym<num> { \d+ } }; say Foo.parse: '+20';
22:44 camelia rakudo-moar ee663c: OUTPUT«「+20」␤ digit => 「+」␤ digit => 「20」␤»
22:44 Zoffix I mean for this ^ to say 'sign' => + / num => 20
22:45 bbkr joined #perl6
22:50 raiph Zoffix: I don't understand what you're thinking with that grammar. So lemme try my own way to do what I think you mean to do.
22:50 Zoffix m: grammar Foo { token TOP { <digit>+ }; proto token digit {*}; token digit:sym<sign> { $<sign> = <[+-]> }; token digit:sym<num> { $<num> = \d+ } }; say Foo.parse: '+20';
22:50 camelia rakudo-moar ee663c: OUTPUT«「+20」␤ digit => 「+」␤  sign => 「+」␤ digit => 「20」␤  num => 「20」␤»
22:50 Zoffix like this, but without the 'digit' keys :)
22:53 raiph m: grammar Foo { token TOP { <sign> <digits> }; token sign { < + - > }; token digits { \d+ } }; g.parse: '+20'
22:53 camelia rakudo-moar ee663c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    g used at line 1␤␤»
22:53 raiph m: grammar Foo { token TOP { <sign> <digits> }; token sign { < + - > }; token digits { \d+ } }; Foo.parse: '+20'
22:53 camelia rakudo-moar ee663c: ( no output )
22:53 raiph m: grammar Foo { token TOP { <sign> <digits> }; token sign { < + - > }; token digits { \d+ } }; say Foo.parse: '+20'
22:53 camelia rakudo-moar ee663c: OUTPUT«「+20」␤ sign => 「+」␤ digits => 「20」␤»
22:53 stevieb9 joined #perl6
22:53 Zoffix Yeah, I know of that way, I was just curious of the :sym<> stuff
22:54 Zoffix It's fine, I'll play with it around later and figure it out :)
22:54 raiph Fair enough :)
22:56 raiph Zoffix: The `foo:sym<this>` does the alternate matching thing I mentioned plus I think that `<sym>` within the foo rule matches 'this'
22:56 Zoffix Thanks.
22:59 raiph m: grammar Foo { token TOP { <.digit>+ }; proto token digit {*}; token digit:sym<sign> { $<sign> = <[+-]> }; token digit:sym<num> { $<num> = \d+ } }; say Foo.parse: '+20';
22:59 camelia rakudo-moar ee663c: OUTPUT«「+20」␤»
22:59 zacts joined #perl6
23:00 stevieb9 is "has Bool $!disabled = False;" valid? In one of my test files, after creating a second subtest that creates a second, separate object, I get: "P6opaque: no such attribute '$!disabled' in type Log::Simple when trying to check if it's initialized
23:00 stevieb9 " and can't figure out for the life of me why. I've tried using a BUILD submethod, but then I get different errors.
23:00 Zoffix stevieb9, yeah, it is
23:01 Zoffix m: say class Foo { has Bool $!disabled = False; method dis { $!disabled } }.new.dis
23:01 camelia rakudo-moar ee663c: OUTPUT«False␤»
23:01 stevieb9 m: say class Foo { has Bool $!disabled = False; method dis { defined $!disabled } }.new.dis
23:01 camelia rakudo-moar ee663c: OUTPUT«True␤»
23:01 stevieb9 hmmm
23:04 sortiz m: False.defined.say; # False and True are indeed defined
23:04 camelia rakudo-moar ee663c: OUTPUT«True␤»
23:04 timotimo when you build your own BUILD, default values won't work any more ... or something like that?
23:05 stevieb9 it barfs always in the second subtest, as I create a new object. One object per subtest. If I move the subtests around, it always fails at the second object creation, so it doesn't appear to be test related
23:05 Zoffix stevieb9, why not show the full code?
23:06 Zoffix left #perl6
23:06 stevieb9 test: https://github.com/stevieb9/perl6-log-simple/blob/master/t/005-fallback-methods.t
23:07 stevieb9 code: https://github.com/stevieb9/perl6-log-simple/blob/master/lib/Log/Simple.pm6
23:08 jjido joined #perl6
23:10 stevieb9 I think I lied. It looks like it always dies in the test that call the "_N" methods, which in turn calls log() (the dies-ok() tests)
23:10 ShimmerFairy there isn't a lot of documentation on how HLL::Grammar's operator precedence parser works, is there? (Trying to figure out what specific keys do is tough.)
23:14 ShimmerFairy e.g. I spot a 'uassoc' key that appears to be unused, but which I'm guessing determines the left/right associativity for unary ops (which are otherwise marked :assoc<unary>)
23:14 raiph stevieb: you're composing an object in FALLBACK?
23:16 raiph (Well, adding methods and recomposing, but I'm still surprised and suspicious of such a power move)
23:17 stevieb9 my goal there is to auto-generate methods so that I don't have to repeat a whole bunch of code, but I'm too new to understand if that's breaking other things
23:20 stevieb9 the following works fine, and does what I expect: perl6 -MLog::Simple -e 'my $l=Log::Simple.new; my $l2=Log::Simple.new; $l._7("obj1"); $l2._2("obj2");'
23:21 stevieb9 so I don't know what's up with the test file
23:22 stevieb9 hmmm, this doesn't though: perl6 -MLog::Simple -e 'my $l=Log::Simple.new; $l._3("obj1 3"); my $l2=Log::Simple.new; $l._7("obj1"); $l2._2("obj2");'
23:22 stevieb9 so if I call log() (through the numbered methods) prior to creating the second object, it breaks.
23:26 stevieb9 unfortunately I've got to take off for a while, but I'll play around again later. I may just have to take a step back and write simpler code until I can start better understanding what's actually happening :)
23:28 raiph stevieb9: If I figure anything out I'll .tell you. Maybe catch you later. o/
23:38 AlexDaniel “The following list is stolen from the Perl 5 perlunicode documentation:” :D
23:38 AlexDaniel not sure if “stolen” is the right word, but it is funny :)
23:40 sortiz Surprised by the change in REPL output from 2016.06+, now the eval result is printed even when undefined (i.e, a simple "enter" produces Nil). Is this change documented?
23:42 abruanese joined #perl6
23:44 ShimmerFairy Oh, that reminds me, I had an idea to "rewrite" the synopses using the tests as a base; something like literate programming, though not necessarily put the doc part in-source. The idea being that someone wanting to learn the exact specification of P6 would likely prefer English to read :)
23:54 BrokenRobot sortiz: it's likely caused by awwaiid++'s REPL rework. It went in about a week before the release: https://github.com/rakudo/rakudo/pull/738
23:55 BrokenRobot As for documented: no idea. It wasn't mentioned in the release notes/change log as I figured it was just an internal change that weren't supposed to have any user-facing side effects
23:59 sortiz BrokenRobot, Well. I like it, only that just now notice it :-)

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

Perl 6 | Reference Documentation | Rakudo