Re: 'Core' Language Philosophy [was: Re: 'catch' statement modifier]

2003-11-27 Thread Michael G Schwern
On Wed, Nov 26, 2003 at 03:56:28PM -0500, Mark J. Reed wrote: Nicer it may be, But I use File::Find *because* it's in the core, so I don't have to worry about my programs being non-portable because I use a module that may not be installed. Of course with Perl 6 modules will be MUCH easier to

Re: 'Core' Language Philosophy [was: Re: 'catch' statement modifier]

2003-11-26 Thread chromatic
On Wed, 2003-11-26 at 11:39, Michael Lazzaro wrote: I think we also need to be skeptical of the false economy of putting such sugar into CP6AN, if a sizable portion of the community is going to download it anyway. A more interesting question is *when* to put something into the core language

Re: 'Core' Language Philosophy [was: Re: 'catch' statement modifier]

2003-11-26 Thread Larry Wall
On Wed, Nov 26, 2003 at 11:39:41AM -0800, Michael Lazzaro wrote: : On Monday, November 24, 2003, at 03:28 PM, Luke Palmer wrote: : Damian Conway writes: : In which case I think we just fall back to: : : try{$opus.write_to_file($file); CATCH {die Couldn't write to : $file: : $!}} : :

Re: 'Core' Language Philosophy [was: Re: 'catch' statement modifier]

2003-11-26 Thread Mark J. Reed
On 2003-11-26 at 12:13:39, chromatic wrote: Consider Perl 5, where File::Find is a core module. While the interface may have been nice in 1995 (though I doubt even that), it's been widely regarded as awful for at least three years. It's likely never to be removed from the core.

Re: 'Core' Language Philosophy [was: Re: 'catch' statement modifier]

2003-11-26 Thread Michael Lazzaro
On Wednesday, November 26, 2003, at 12:13 PM, chromatic wrote: On Wed, 2003-11-26 at 11:39, Michael Lazzaro wrote: I think we also need to be skeptical of the false economy of putting such sugar into CP6AN, if a sizable portion of the community is going to download it anyway. A more interesting

Re: 'Core' Language Philosophy [was: Re: 'catch' statement modifier]

2003-11-26 Thread Simon Cozens
[EMAIL PROTECTED] (Michael Lazzaro) writes: I think we also need to be skeptical of the false economy of putting such sugar into CP6AN, if a sizable portion of the community is going to download it anyway. The standard Perl library will be almost entirely removed. The point of this is to force

Re: 'Core' Language Philosophy [was: Re: 'catch' statement modifier]

2003-11-26 Thread Michael Lazzaro
On Wednesday, November 26, 2003, at 01:50 PM, Michael Lazzaro wrote: my $c = (defined($a) ? $a : $b); Sorry, P5. Before the grammar police attack... my $c = (defined($a) ?? $a :: $b); Parens for clarity. MikeL

Re: 'Core' Language Philosophy [was: Re: 'catch' statement modifier]

2003-11-26 Thread Michael Lazzaro
On Wednesday, November 26, 2003, at 12:29 PM, Larry Wall wrote: If you contrast it with an explicit try block, sure, it looks better. But that's not what I compare it with. I compare it with Perl 5's: $opus.write_to_file($file) or die Couldn't write to $file: $!; That has some known

Re: 'catch' statement modifier

2003-11-24 Thread Luke Palmer
Damian Conway writes: Hmm. I think I may have missed Luke's point. Which was (presumably): what if C$opus.write_to_file($file); validly returns Cundef? In which case I think we just fall back to: try{$opus.write_to_file($file); CATCH {die Couldn't write to $file: $!}}

'catch' statement modifier

2003-11-23 Thread Luke Palmer
I was reading over some code that used the MIDI module, and saw the Cwrite_to_file method. I began wondering, how does one report the error if he feels like it, but let the module report the error if not, in a concise way. What about something along the lines of a Ccatch statement modifier,

Re: 'catch' statement modifier

2003-11-23 Thread Tony Olekshy
Luke ~ These matters are covered at some length in RFC 88 and Apocalypse 4. http://www.avrasoft.com/perl6/rfc88.htm http://www.perl.com/pub/a/2002/01/15/apo4.html Yours, c, Tony Olekshy Luke Palmer wrote, at 2003-11-23 11:55: I was reading over some code that used the MIDI module,

Re: 'catch' statement modifier

2003-11-23 Thread Damian Conway
I was reading over some code that used the MIDI module, and saw the Cwrite_to_file method. I began wondering, how does one report the error if he feels like it, but let the module report the error if not, in a concise way. What about something along the lines of a Ccatch statement modifier, like:

RE: 'catch' statement modifier

2003-11-23 Thread Austin Hastings
-Original Message- From: Damian Conway [mailto:[EMAIL PROTECTED] Remember that a Ctry without a CCATCH catches all exceptions and returns Cundef (the same as a Perl 5 Ceval block does). So you just want: try { $opus.write_to_file($file) } err die

Re: 'catch' statement modifier

2003-11-23 Thread Damian Conway
Austin Hastings wrote: try { $opus.write_to_file($file) } err die Couldn't write to $file: $!\n; Is that Cerr die or Cor die ? It's Cerr, which is low precedence C//. And if so, what's Cerr and where can I find more on it?

Re: 'catch' statement modifier

2003-11-23 Thread Damian Conway
Hmm. I think I may have missed Luke's point. Which was (presumably): what if C$opus.write_to_file($file); validly returns Cundef? In which case I think we just fall back to: try{$opus.write_to_file($file); CATCH {die Couldn't write to $file: $!}} which is, after all, only 5 characters

Re: 'catch' statement modifier

2003-11-23 Thread Jonathan Scott Duff
On Sun, Nov 23, 2003 at 03:53:00PM -0500, Austin Hastings wrote: -Original Message- From: Damian Conway [mailto:[EMAIL PROTECTED] Remember that a Ctry without a CCATCH catches all exceptions and returns Cundef (the same as a Perl 5 Ceval block does). So you just want: