From grant at mclean.net.nz Mon Aug 4 19:49:03 2014 From: grant at mclean.net.nz (Grant McLean) Date: Tue, 05 Aug 2014 14:49:03 +1200 Subject: [Wellington-pm] Meeting next Tuesday Message-ID: <1407206943.2851.107.camel@putnam.wgtn.cat-it.co.nz> Hi Mongers The August meeting of Wellington Perl Mongers is on next Tuesday. Usual place and time: 6:00pm Tuesday 12 August 2014 Level 3, Catalyst House 150 Willis Street Wellington http://wellington.pm.org/ We have Raf lined up to talk about Moose. If someone else wants to do a short talk on something else then let me know. Cheers Grant From florent.mara at nzregen.co.nz Wed Aug 6 14:15:42 2014 From: florent.mara at nzregen.co.nz (Florent Mara) Date: Thu, 7 Aug 2014 09:15:42 +1200 Subject: [Wellington-pm] Meeting next Tuesday In-Reply-To: <1407206943.2851.107.camel@putnam.wgtn.cat-it.co.nz> References: <1407206943.2851.107.camel@putnam.wgtn.cat-it.co.nz> Message-ID: How awesome! I did not even miss the Moose talk. See you all next Tuesday. On Tue, Aug 5, 2014 at 2:49 PM, Grant McLean wrote: > Hi Mongers > > The August meeting of Wellington Perl Mongers is on next Tuesday. Usual > place and time: > > 6:00pm Tuesday 12 August 2014 > Level 3, Catalyst House > 150 Willis Street > Wellington > http://wellington.pm.org/ > > We have Raf lined up to talk about Moose. If someone else wants to do a > short talk on something else then let me know. > > Cheers > Grant > > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From grant at mclean.net.nz Mon Aug 11 16:16:45 2014 From: grant at mclean.net.nz (Grant McLean) Date: Tue, 12 Aug 2014 11:16:45 +1200 Subject: [Wellington-pm] Reminder: meeting this evening Message-ID: <1407799005.25094.11.camel@putnam.wgtn.cat-it.co.nz> Hi Mongers The August meeting of Wellington Perl Mongers is on this evening. Usual place and time: 6:00pm Tuesday 12 August 2014 Level 3, Catalyst House 150 Willis Street Wellington http://wellington.pm.org/ We have Raf lined up to talk about Moose and Olly talking about Perl API design. Cheers Grant From grant at mclean.net.nz Tue Aug 12 17:54:58 2014 From: grant at mclean.net.nz (Grant McLean) Date: Wed, 13 Aug 2014 12:54:58 +1200 Subject: [Wellington-pm] Round-up of last night's meeting Message-ID: <1407891298.5476.11.camel@putnam.wgtn.cat-it.co.nz> Hi Mongers Thank you to Raf and Olly for two interesting talks last night. I'll put slides up on the web site if/when I receive them. Further to Raf's Moose talk, the 'Moose Manual' ships with Moose but is also available online: https://metacpan.org/pod/distribution/Moose/lib/Moose/Manual.pod Further to Olly's talk/discussion, I referenced the API for the Lucy search tool which is described here: https://metacpan.org/pod/distribution/Lucy/lib/Lucy.pod There's also documentation for the Lucy::Search::Hits results iterator class, but it doesn't do much more than provide a ->next() method that returns either a hashref describing the next document or undef at the end of the resultset. The next meeting will be on September the 9th. Raf has volunteered to talk about Test::Routine and I'd be delighted to hear from anyone else who wishes to speak. Cheers Grant From olly at survex.com Tue Aug 12 18:29:23 2014 From: olly at survex.com (Olly Betts) Date: Wed, 13 Aug 2014 02:29:23 +0100 Subject: [Wellington-pm] Round-up of last night's meeting In-Reply-To: <1407891298.5476.11.camel@putnam.wgtn.cat-it.co.nz> References: <1407891298.5476.11.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <20140813012920.GZ2487@survex.com> On Wed, Aug 13, 2014 at 12:54:58PM +1200, Grant McLean wrote: > Further to Olly's talk/discussion [...] Thanks for the interesting and useful (to me at least, but I hope others also benefited) discussion. Here is some of the iterator stuff I've found on CPAN when looking before: Iterator - http://search.cpan.org/dist/Iterator/Iterator.pm API: value() gives the next entry, throwing an exception if done. Has is_exhausted() and isnt_exhausted() to check for the end. | This module is meant to be the definitive implementation of iterators, | as popularized by Mark Jason Dominus's lectures and recent book (Higher | Order Perl, Morgan Kauffman, 2005). It's not been updated since 2005, which makes me wonder if it's actually used much - even for a simple module you'd think there would have been a bug report or documentation enhancement in close to 9 years. Array::Iterator - http://search.cpan.org/dist/Array-Iterator/lib/Array/Iterator.pm API: next() gives the next entry, throwing an exception if done, or get_next() if you want undef if done. Has has_next() to check for the end. Iterator::Simple - http://search.cpan.org/dist/Iterator-Simple/lib/Iterator/Simple.pm API: next() (or <$it> or $it->()) gives the next entry or undef if done. I've not looked up the various pointers people gave last night, but based on the discussion last night, Iterator::Simple's API seems like a good model (and I'd never want to return undef as a value). Allowing <$it> to work is perhaps a nice touch, since you can then take advantage of the special handling of <> in while, so this won't give up if the iterator returns 0 or "0" (though I think all Xapian's iterators would actually return an object): while (my $x = <$it>) { process($x); } Rather than having to write: while (defined(my $x = $it->next())) { process($x); } And based only on the name, I think it's the one Grant would favour. Cheers, Olly From grant at mclean.net.nz Thu Aug 14 18:02:40 2014 From: grant at mclean.net.nz (Grant McLean) Date: Fri, 15 Aug 2014 13:02:40 +1200 Subject: [Wellington-pm] Round-up of last night's meeting In-Reply-To: <20140813012920.GZ2487@survex.com> References: <1407891298.5476.11.camel@putnam.wgtn.cat-it.co.nz> <20140813012920.GZ2487@survex.com> Message-ID: <1408064560.5476.50.camel@putnam.wgtn.cat-it.co.nz> Hmm, just closed a window and found this half-written email hiding behind it ... On Wed, 2014-08-13 at 02:29 +0100, Olly Betts wrote: > Here is some of the iterator stuff I've found on CPAN when looking > before: > > Iterator - http://search.cpan.org/dist/Iterator/Iterator.pm > > API: value() gives the next entry, throwing an exception if done. > Has is_exhausted() and isnt_exhausted() to check for the end. I'm really not a fan of throwing an exception "if done" - doesn't seem very Perlish. Reaching the end of the end of the result set seems like a boundary condition rather than an exception. Trying to read *past* the end of a result set might be worthy of an exception. > Array::Iterator - http://search.cpan.org/dist/Array-Iterator/lib/Array/Iterator.pm > > API: next() gives the next entry, throwing an exception if done, or > get_next() if you want undef if done. Has has_next() to check for the > end. I guess at least that give the user the choice of avoiding exceptions. > Iterator::Simple - http://search.cpan.org/dist/Iterator-Simple/lib/Iterator/Simple.pm > > API: next() (or <$it> or $it->()) gives the next entry or undef if done. That's starting to look more like Perl :-) > And based only on the name, I think it's the one Grant would favour. Hard to fault that logic. Cheers Grant