London.pm Sichuan TianFu Buyi Thursday 1pm

2011-11-07 Thread Leon Brocard
It's time to have another Sichuan lunch meeting. This restaurant has
been mentioned on list before (it used to be called Bamboo House) - it
does amazing (sometimes spicy) Sichuan dishes.

London.pm Sichuan is a social event where we meet up every Thursday at
1pm at a different Sichuan restaurant, spend about an hour (and about
£10 cash) eating tasty Sichuan food, then go our separate ways.

TianFu Buyi
Thursday 1pm
37-39 Bulwer Street
W12 8AR
Shephard's Bush Market,  Shephard's Bush Tube
http://maps.google.co.uk/maps?q=W12+8AR
http://london.randomness.org.uk/wiki.cgi?Tian_Fu%2C_W12_8AR
https://secure.wikimedia.org/wikipedia/en/wiki/Szechuan_cuisine

See you there! Léon


Re: "Exiting eval via next" [perl v5.14]

2011-11-07 Thread Peter Haworth
On Fri, 4 Nov 2011 21:49:49 +, Dave Hodgkinson wrote:
> On 4 Nov 2011, at 20:16, Graham Barr wrote:
> > On Nov 4, 2011, at 11:36 , Chisel wrote:
> >> 
> >> # why no error?!
> >> $ perl -M5.14.0 -wle 'for my $i (qw/foo/) { eval { $i.=q{}; next; }; } say
> >> "done"'
> >> done
> > 
> > Because the next never happens, check $@ you will see
> > 
> > Modification of a read-only value attempted
> 
> A more enlightening error would be nice.
> 
> I find myself tempted to next in the $@ check. What's a good 
> idiom for failing out of an eval then?

Isn't that what die or return are for? Assuming that eval is the only thing
in the body of the loop, of course.

-- 
Peter Haworth| I unicycled 140 miles coast to coast for BHF
p...@edison.ioppublishing.com | Please sponsor me at justgiving.com/pmh1wheel
 
"Beekeeping is like being a lion tamer,
 but with smaller lions, and more of them."
-- arp

This email (and attachments) are confidential and intended for the addressee(s) 
only. If you are not the intended recipient please notify the sender, 
delete any copies and do not take action in reliance on it. Any views expressed 
are the author's and do not represent those of IOP, except where specifically 
stated. IOP takes reasonable precautions to protect against viruses but accepts 
no responsibility for loss or damage arising from virus infection. 
For the protection of IOP's systems and staff emails are scanned 
automatically.” 

Institute of Physics Registered in England under Registration No 293851 
Registered Office:  76/78 Portland Place, London W1B 1NT  


Re: "Exiting eval via next" [perl v5.14]

2011-11-07 Thread Dave Hodgkinson

On 7 Nov 2011, at 11:55, Peter Haworth wrote:

> On Fri, 4 Nov 2011 21:49:49 +, Dave Hodgkinson wrote:
>> On 4 Nov 2011, at 20:16, Graham Barr wrote:
>>> On Nov 4, 2011, at 11:36 , Chisel wrote:
 
 # why no error?!
 $ perl -M5.14.0 -wle 'for my $i (qw/foo/) { eval { $i.=q{}; next; }; } say
 "done"'
 done
>>> 
>>> Because the next never happens, check $@ you will see
>>> 
>>> Modification of a read-only value attempted
>> 
>> A more enlightening error would be nice.
>> 
>> I find myself tempted to next in the $@ check. What's a good 
>> idiom for failing out of an eval then?
> 
> Isn't that what die or return are for? Assuming that eval is the only thing
> in the body of the loop, of course.

True. I'm ingesting HoP at the moment, hopefully some of that will
rub off into better structured code.




Re: "Exiting eval via next" [perl v5.14]

2011-11-07 Thread Nicholas Clark
On Mon, Nov 07, 2011 at 12:08:54PM +, Dave Hodgkinson wrote:

> True. I'm ingesting HoP at the moment, hopefully some of that will
> rub off into better structured code.

Strangely, the most immediate effect it had was on my C code.
(I spotted places where I could uses function pointers.)


I still owe MJD a proper review for Higher Order Perl. For now, the
executive summary will have to suffice:

   Don't only *buy* this book - read it.

Nicholas Clark.