Re: The distinction between "do BLOCK while COND" and "EXPR while COND" should go

2000-08-31 Thread Jonathan Scott Duff
On Thu, Aug 31, 2000 at 02:13:23PM -0500, Christopher J. Madsen wrote: > Jonathan Scott Duff writes: > >do { ... last; ... }; # exit the block immediately > >do { ... next; ... }; # equivalent to last? > >

Re: The distinction between "do BLOCK while COND" and "EXPR while COND" should go

2000-08-31 Thread Jonathan Scott Duff
} And what about continue blocks? We can attach them to bare blocks, but not to do blocks? That's weird. > However, I really don't want to see 'return' become a kind of 'last' > for do{}. How would I return from a subroutine from within a do loop? Indeed. -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: RFC 120 (v2) Implicit counter in for statements, possibly$#.

2000-08-30 Thread Jonathan Scott Duff
it rather than hoop-jumping a little? -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: RFC 120 (v2) Implicit counter in for statements, possibly$#.

2000-08-30 Thread Jonathan Scott Duff
ld about the syntax, but I like the idea. If everything become objects under-the-hood, then we could have: for $a (@array) { print "$a is at $a->index\n"; } No, I'm not wild about that either, but it's an idea. -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: RFC 120 (v2) Implicit counter in for statements, possibly $#.

2000-08-29 Thread Jonathan Scott Duff
2. Explicit variable between foreach and the array: might conflict > with other proposals. > 3. Explicit counter in the body of the for/each loop: a clean > solution but requires a new or reused function. What happened to explicit variable(s) *after* the list?

Re: RFC 120 (v2) Implicit counter in for statements, possibly $#.

2000-08-18 Thread Jonathan Scott Duff
# Oops! } In this example, the programmer may realize his mistake when he sees " is at position 0", but in the real world, the body of the loop may be *much* more complicated. How do we help the programmer when he screws up? -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: RFC 120 (v2) Implicit counter in for statements, possibly $#.

2000-08-18 Thread Jonathan Scott Duff
for (@array) $index { ... } -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: "Try? There is no try." -- Yoda's Exception handling syntax

2000-08-15 Thread Jonathan Scott Duff
code that may throw exceptions } Note that's a two-block keyword. > I don't think we should obfuscate classic try/throw/catch/finally > from the ground up. I'm inclined to agree with you, but as you can see, I'm not letting that hamper my brainstorming effort :-) -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: Toward an omnibus Perl 6 Exceptions RFC, v0.1.

2000-08-15 Thread Jonathan Scott Duff
he extra syntax? I see no gain to the programmer or to the > perl internals. These are my thoughts exactly. -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: Toward an omnibus Perl 6 Exceptions RFC, v0.1.

2000-08-15 Thread Jonathan Scott Duff
ray that acts as an exception stack and each exception knows what file/line/whatever? Then you can get both behaviors with a simple for loop: for (@PERL::EXCEPTIONS) { print $_->file, "\t", $_->line, "\n"; } -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: Exceptions and Objects

2000-08-15 Thread Jonathan Scott Duff
On Tue, Aug 15, 2000 at 06:23:57PM -0600, Tony Olekshy wrote: > Jonathan Scott Duff wrote: > > > > What's wrong with just using the switch statement? It seems > > like except and catch are becoming special-purpose switches > > to me. Is it really necessary? &g

Re: "Try? There is no try." -- Yoda's Exception handling syntax

2000-08-15 Thread Jonathan Scott Duff
as to the purpose of an explicit "try." Me too! -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: Exceptions and Objects

2000-08-15 Thread Jonathan Scott Duff
On Tue, Aug 15, 2000 at 06:01:33PM +0100, Graham Barr wrote: > As perl is an exceptional language itself, why not have > `freaks' instead :) How about just "oops"? :-) -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: Exceptions and Objects

2000-08-15 Thread Jonathan Scott Duff
On Tue, Aug 15, 2000 at 11:47:32AM +0100, Graham Barr wrote: > On Mon, Aug 14, 2000 at 10:56:36AM -0500, Jonathan Scott Duff wrote: > > try { } > > catch SomeException { } > > catch SomeOtherException { } > > finally { } > > > > which seems

Re: Exceptions and Objects

2000-08-15 Thread Jonathan Scott Duff
On Mon, Aug 14, 2000 at 08:50:41PM -0600, Tony Olekshy wrote: > Jonathan Scott Duff wrote: > > try { } > > catch { # ALL exceptions > > switch ($@) { > > case ^_->name eq 'IO' { .

Re: Exceptions and Objects

2000-08-14 Thread Jonathan Scott Duff
> text. This doesn't show that the exception object itself has any semantics. If the catcher examines, the object is being passive. Does the object *do* anything? -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: Exceptions and Objects

2000-08-14 Thread Jonathan Scott Duff
an illegal construct? -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: Exceptions and Objects

2000-08-14 Thread Jonathan Scott Duff
ceptions switch ($@) { case ^_->name eq 'IO' { ... } case ^_->canFoo { ... } throw $@; # No cases matched, rethrow } } finally { } -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: Exceptions and Objects

2000-08-13 Thread Jonathan Scott Duff
On Sun, Aug 13, 2000 at 07:27:47PM -0700, Peter Scott wrote: > At 12:22 PM 8/12/00 -0500, Jonathan Scott Duff wrote: > Pretty much. It screams O-O for these reasons: > > An exception is an 'error'. That's already a vague concept. > > An error has text associ

Exceptions and Objects

2000-08-13 Thread Jonathan Scott Duff
the same breath? Does one need objects to have exceptions? Could someone enlighten me or point me at relevant references? thanks, -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]