Re: NEXT and the general loop statement

2006-09-07 Thread Agent Zhang
On 8/17/06, Larry Wall [EMAIL PROTECTED] wrote: I'd say 01234 on the theory that the 3-arg loop is really saying: $n = 0; while $n 5 { NEXT { ++$n } NEXT { print $n } } and also on the theory that block exiting blocks always run in reverse order. Dear Larry, I

[svn:perl6-synopsis] r11817 - doc/trunk/design/syn

2006-09-07 Thread audreyt
Author: audreyt Date: Thu Sep 7 07:07:43 2006 New Revision: 11817 Modified: doc/trunk/design/syn/S04.pod Log: 16:06 agentzh audreyt: could you fix the modifer typo in S04 for me? :) Modified: doc/trunk/design/syn/S04.pod

Cwhen outside of Cgiven

2006-09-07 Thread Trey Harris
markstos++ pointed out the following behavior: use v6-alpha; { when 1 ~~ 0 { say Surprise! } } This code prints Surprise!, because $_ is undef, which is false, just like 1 ~~ 0 is. I'd like to make the following suggestions for Synopsis clarification: 1. It will be a

Re: Cwhen outside of Cgiven

2006-09-07 Thread Mark Stosberg
Trey Harris wrote: markstos++ pointed out the following behavior: use v6-alpha; { when 1 ~~ 0 { say Surprise! } } This code prints Surprise!, because $_ is undef, which is false, just like 1 ~~ 0 is. I'd like to make the following suggestions for Synopsis

Re: Cwhen outside of Cgiven

2006-09-07 Thread Mark J. Reed
On 9/7/06, Mark Stosberg [EMAIL PROTECTED] wrote: To refine this point a bit, the spec is clear that 'when' is useful not just with 'given' but with any block that sets $_. I agree that it should be an error outside of any block that sets $_, I disagree. I don't see aproblem with having it

CATCH: changing the topic and preserving the call stack

2006-09-07 Thread Mark Stosberg
I'll hold up some error handling in CGI::Application as use case some for some CATCH spec refinements. The Perl 5 code is below for reference. First, we handle the exception conditionally based /not/ on the exception itself, but whether we have an exception handle installed to deal with it. Is it