From legrady at gmail.com Sat Mar 12 22:07:05 2016 From: legrady at gmail.com (Tom Legrady) Date: Sun, 13 Mar 2016 01:07:05 -0500 Subject: [tpm] FOSDEM & Perl presentations Message-ID: <56E50389.5090508@gmail.com> Bunch of presentations on Perl5, Perl6 http://video.fosdem.org/2016/h2214/ From arocker at Vex.Net Fri Mar 18 08:27:04 2016 From: arocker at Vex.Net (arocker at Vex.Net) Date: Fri, 18 Mar 2016 11:27:04 -0400 Subject: [tpm] FOSDEM & Perl presentations In-Reply-To: <56E50389.5090508@gmail.com> References: <56E50389.5090508@gmail.com> Message-ID: <96cd5f2e024cc2389a255d38028a9f9c.squirrel@mail.vybenetworks.com> > Bunch of presentations on Perl5, Perl6 > Great presentations, very high quality. They set a standard for other FOSS and YAPC organisers. From jkeen at verizon.net Wed Mar 30 15:50:30 2016 From: jkeen at verizon.net (James E Keenan) Date: Wed, 30 Mar 2016 18:50:30 -0400 Subject: [tpm] March 30 -- google hangout? Message-ID: <56FC5836.6060201@verizon.net> If you're going to have a Google hangout for tonight's talk by Zoffix, can you post a link in #tpm? Thanks. From dave.s.doyle at gmail.com Wed Mar 30 16:03:05 2016 From: dave.s.doyle at gmail.com (Dave Doyle) Date: Wed, 30 Mar 2016 19:03:05 -0400 Subject: [tpm] March 30 -- google hangout? In-Reply-To: <56FC5836.6060201@verizon.net> References: <56FC5836.6060201@verizon.net> Message-ID: Hangout is up, not starting yet: https://plus.google.com/events/cre0samf839svh69bj7q51gt8a0 Just waiting on Zoffix! -- dave.s.doyle at gmail.com On 30 March 2016 at 18:50, James E Keenan wrote: > If you're going to have a Google hangout for tonight's talk by Zoffix, can > you post a link in #tpm? > > Thanks. > _______________________________________________ > toronto-pm mailing list > toronto-pm at pm.org > http://mail.pm.org/mailman/listinfo/toronto-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.s.doyle at gmail.com Wed Mar 30 16:13:35 2016 From: dave.s.doyle at gmail.com (Dave Doyle) Date: Wed, 30 Mar 2016 19:13:35 -0400 Subject: [tpm] March 30 -- google hangout? In-Reply-To: References: <56FC5836.6060201@verizon.net> Message-ID: We've had trouble getting our speaker into the building. :) Should be starting in the near future. -- dave.s.doyle at gmail.com On 30 March 2016 at 19:03, Dave Doyle wrote: > Hangout is up, not starting yet: > > https://plus.google.com/events/cre0samf839svh69bj7q51gt8a0 > > Just waiting on Zoffix! > > -- > dave.s.doyle at gmail.com > > On 30 March 2016 at 18:50, James E Keenan wrote: > >> If you're going to have a Google hangout for tonight's talk by Zoffix, >> can you post a link in #tpm? >> >> Thanks. >> _______________________________________________ >> toronto-pm mailing list >> toronto-pm at pm.org >> http://mail.pm.org/mailman/listinfo/toronto-pm >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zoffix at zoffix.com Wed Mar 30 20:22:45 2016 From: zoffix at zoffix.com (zoffix at zoffix.com) Date: Wed, 30 Mar 2016 23:22:45 -0400 Subject: [tpm] Answers to some questions for tonight's talk Message-ID: <20160330232245.Horde.xDIOEyGLqQ4qYYWmHBnUS96@echo.gendns.com> Hey, Thanks again for having me. Now that I got a Perl 6 compiler at my hands to play with, I can answer a couple of questions that were asked: 1) Better messages for where { ... } subsets. The code in the `where` can be anything you want, so you can `warn` or `fail` inside the check to get a better error message. Once caveat: the argument given to `callframe` might be different depending on where you're performing the check. Try adjusting it: subset Foo of Int where { $_ > 10_000 or fail "You need a number more than 10,000 on " ~ "line {(callframe 4).line}, but you passed $_"; }; my Foo $x = 1000; # OUTPUT: # You need a number more than 10,000 on line 7, but you passed 1000 # in block at test.p6 line 2 2) As far as testing whether something fits the subset, you can use this trick with trying to assign to a variable and catching the exception. It feels a bit like a hack, but I'm unsure if there's a better way: subset Foo of Int where { $_ > 10_000 or fail "You need a number more than 10,000 on " ~ "line {(callframe 4).line}, but you passed $_"; }; my $value = 42; try { my Foo $x = $value; CATCH { fail "It's no good" }; }; say "It's fine"; # OUTPUT: # It's no good # in block at test.p6 line 8 # in block at test.p6 line 8 3) "Can you have an infinite Set?" No, it tries to actually create one. Makes sense, since a set cares about the elements. Sure, it's possible to special-case some forms of sequences to figure out whether an element is part of the sequence or not, but it's probably not worth it. In a more general case, you are faced with the Halting Problem. Speaking of which, here is a gotcha with the sequence operator and the upper limit: my @seq = 0, 2 ... * == 1001; Here, I'm using the sequence operator to create a sequence of even numbers, and I'm limiting the upper bound by when it'd be equal to 1001. But it won't ever be equal to that. To human brain, it might seem obvious that once you're over 1001, you should stop here, but to a computer it's a Halting Problem and it'll keep trying to find the end point (so it'll never complete here). 4) Places to learn Perl 6: along with http://perl6intro.com/ that I mentioned during the talk, there's also Learn X in Y Minues Perl 6 page, which I personally found very useful when just starting out with Perl 6: https://learnxinyminutes.com/docs/perl6/ I'm also including the link to the Ecosystem: http://modules.perl6.org/ you should have `panda` program installed, and you can install modules from the Ecosystem by typing `panda install Foo::Bar` These are all that I can remember being asked. Hope it helps. Cheers, ZZ From zoffix at zoffix.com Thu Mar 31 04:55:03 2016 From: zoffix at zoffix.com (zoffix at zoffix.com) Date: Thu, 31 Mar 2016 07:55:03 -0400 Subject: [tpm] Answers to some questions for tonight's talk In-Reply-To: <20160330232245.Horde.xDIOEyGLqQ4qYYWmHBnUS96@echo.gendns.com> Message-ID: <20160331075504.Horde.OMrP2OO5pfICZL7XdCoJweP@echo.gendns.com> Turns out there's a much simpler way to check if a value fits a subset: just smartmatch against it! subset Even where * %% 2; say 3 ~~ Even; say 42 ~~ Even # OUTPUT: # False # True Hope this helps. Cheers, ZZ Quoting zoffix at zoffix.com: > Hey, > > Thanks again for having me. > > Now that I got a Perl 6 compiler at my hands to play with, I can > answer a couple of questions that were asked: > > 1) > > Better messages for where { ... } subsets. The code in the `where` > can be anything you want, so you can `warn` or `fail` inside the > check to get a better error message. Once caveat: the argument given > to `callframe` might be different depending on where you're > performing the check. Try adjusting it: > > > subset Foo of Int where { > $_ > 10_000 > or fail "You need a number more than 10,000 on " > ~ "line {(callframe 4).line}, but you passed $_"; > }; > > my Foo $x = 1000; > > # OUTPUT: > # You need a number more than 10,000 on line 7, but you passed 1000 > # in block at test.p6 line 2 > > 2) > > As far as testing whether something fits the subset, you can use > this trick with trying to assign to a variable and catching the > exception. It feels a bit like a hack, but I'm unsure if there's a > better way: > > subset Foo of Int where { > $_ > 10_000 > or fail "You need a number more than 10,000 on " > ~ "line {(callframe 4).line}, but you passed $_"; > }; > > my $value = 42; > try { my Foo $x = $value; CATCH { fail "It's no good" }; }; > say "It's fine"; > > # OUTPUT: > # It's no good > # in block at test.p6 line 8 > # in block at test.p6 line 8 > > 3) > > "Can you have an infinite Set?" > > No, it tries to actually create one. Makes sense, since a set cares > about the elements. Sure, it's possible to special-case some forms > of sequences to figure out whether an element is part of the > sequence or not, but it's probably not worth it. In a more general > case, you are faced with the Halting Problem. Speaking of which, > here is a gotcha with the sequence operator and the upper limit: > > my @seq = 0, 2 ... * == 1001; > > Here, I'm using the sequence operator to create a sequence of even > numbers, and I'm limiting the upper bound by when it'd be equal to > 1001. But it won't ever be equal to that. To human brain, it might > seem obvious that once you're over 1001, you should stop here, but > to a computer it's a Halting Problem and it'll keep trying to find > the end point (so it'll never complete here). > > 4) > > Places to learn Perl 6: along with http://perl6intro.com/ that I > mentioned during the talk, there's also Learn X in Y Minues Perl 6 > page, which I personally found very useful when just starting out > with Perl 6: https://learnxinyminutes.com/docs/perl6/ > > I'm also including the link to the Ecosystem: > http://modules.perl6.org/ you should have `panda` program > installed, and you can install modules from the Ecosystem by typing > `panda install Foo::Bar` > > > These are all that I can remember being asked. > > Hope it helps. > > Cheers, > ZZ > > _______________________________________________ > toronto-pm mailing list > toronto-pm at pm.org > http://mail.pm.org/mailman/listinfo/toronto-pm From arocker at Vex.Net Thu Mar 31 14:54:54 2016 From: arocker at Vex.Net (arocker at Vex.Net) Date: Thu, 31 Mar 2016 17:54:54 -0400 Subject: [tpm] Discipline required. In-Reply-To: <20160331075504.Horde.OMrP2OO5pfICZL7XdCoJweP@echo.gendns.com> References: <20160331075504.Horde.OMrP2OO5pfICZL7XdCoJweP@echo.gendns.com> Message-ID: <797aa99d7630c3b953787aa5cd5c2a1d.squirrel@mail.vybenetworks.com> No, not that kind. :-)* I'm talking about Perl 6. There's a definition of a gentleman; "A man who knows how to play the accordion, and doesn't". Another one may well be "A Perl 6 maven is someone who understands the language well enough to redefine it, and doesn't." The facilities available to define (and redefine) operators and other features would be easy to abuse, creating ill-documented and confusing code, and giving the language an unfortunate reputation before it has a chance to become established. It's ridiculously rich, and consequently needs time to learn, a job which is not made easier by instability. We need to build on rock for a while, not sand. Even some of the facilities provided by features like multi subs have the unfortunate possibility of creating "spooky action at a distance", if not used carefully. (Changes in non-visible, and apparently unrelated, code could change behaviours.) I'm not criticising P6, or its design, just suggesting that like any powerful thing, it needs to be handled carefully until well understood.