Re: End-of-scope actions: Toward a hybrid approach.

2001-02-13 Thread David L. Nicol
Tony Olekshy wrote: > If we take this approach then when you just want to casually say > > my $f = open $file; always { close $f }; > > you can. I like that. In addition, when you want to carefully ... How about "later" instead of "always" Because: "later" is a time in the future, but

Re: End-of-scope actions: Garbage collection.

2001-02-13 Thread Dan Sugalski
At 03:56 PM 2/12/2001 -0700, Tony Olekshy wrote: >Dan Sugalski wrote: > > > > [...] I wasn't talking about try{}/finally{} stuff. I was talking > > about DESTROY (or its equivalent) for objects, which unfortunately > > can't be tied to any one particular place in the code. > >and, from another thr

Re: End-of-scope actions: Toward a hybrid approach.

2001-02-13 Thread Glenn Linderman
Tony Olekshy wrote: > 2. Support always and except blocks. These constructs may be used > without requiring a try before the block. They are dynamic > operations which only come into play when they are encountered > in the block, in run-time order. ... > If we take this approach

Re: End-of-scope actions: do/eval duality.

2001-02-13 Thread Glenn Linderman
Tony Olekshy wrote: > Traditionally Perl has had both the "do" and the "eval" block > forms, the latter which traps, the former which doesn't. In the perl 5 pocket reference 3rd edition page 63, it claims that $@ is set to the result of an eval or do. How does this impact exception handling tes

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-13 Thread Peter Scott
At 06:35 PM 2/13/01 +, Nicholas Clark wrote: > > This may be a naive question, but what is the benefit - aside from > > consistency, and we don't need to rehash the litany on that - to AUTOLOAD > > getting called for DESTROY? I've never actually seen any code that makes > > use of it. I hav

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-13 Thread Dan Sugalski
At 10:32 AM 2/13/2001 -0800, Peter Scott wrote: >At 01:16 PM 2/13/01 -0500, James Mastros wrote: >>On Tue, Feb 13, 2001 at 01:09:11PM -0500, John Porter wrote: >>Certainly AUTOLOAD gets >> > called if DESTROY is called but not defined ... just >> > like any other method. >>The idea is [for Larry]

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-13 Thread Nicholas Clark
On Tue, Feb 13, 2001 at 10:32:26AM -0800, Peter Scott wrote: > At 01:16 PM 2/13/01 -0500, James Mastros wrote: > >On Tue, Feb 13, 2001 at 01:09:11PM -0500, John Porter wrote: > >Certainly AUTOLOAD gets > > > called if DESTROY is called but not defined ... just > > > like any other method. > >The i

Re: End-of-scope actions: Background.

2001-02-13 Thread Peter Scott
At 10:35 AM 2/13/01 -0800, I wrote: >I think you'll find this addressed already in RFCs 70, 80, and 151. At >least, that was my intention. Urp, poorly worded. Should be, "my intention in the two RFCs out of these three that I wrote." Don't want to appear to be trying to claim credit for RFC

Re: End-of-scope actions: Background.

2001-02-13 Thread Peter Scott
At 03:27 PM 2/13/01 +, Nicholas Clark wrote: >I fear I'm not adding anything apart from noise to this debate. >(partly from not having thought through the issues completely, partly by >not reading the full archives for the list from last year) > >On Mon, Feb 12, 2001 at 01:58:35PM -0700, Tony

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-13 Thread Peter Scott
At 01:16 PM 2/13/01 -0500, James Mastros wrote: >On Tue, Feb 13, 2001 at 01:09:11PM -0500, John Porter wrote: >Certainly AUTOLOAD gets > > called if DESTROY is called but not defined ... just > > like any other method. >The idea is [for Larry] to declare "no, it isn't". Otherwise, you have to >do

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-13 Thread schwern
On Tue, Feb 13, 2001 at 01:09:11PM -0500, John Porter wrote: > > >"It isn't possible to AUTOLOAD DESTROY." --perlmem(6) > > I'm not sure what that means. Certainly AUTOLOAD gets > called if DESTROY is called but not defined ... just > like any other method. Yes, its a classic autoloader mistake

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-13 Thread James Mastros
On Tue, Feb 13, 2001 at 01:09:11PM -0500, John Porter wrote: > > James Mastros wrote: > > >"It isn't possible to AUTOLOAD DESTROY." --perlmem(6) [Note: that's a hypothetical quote.] > I'm not sure what that means. Certainly AUTOLOAD gets > called if DESTROY is called but not defined ... just > l

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-13 Thread John Porter
> James Mastros wrote: > > >"It isn't possible to AUTOLOAD DESTROY." --perlmem(6) I'm not sure what that means. Certainly AUTOLOAD gets called if DESTROY is called but not defined ... just like any other method. -- John Porter

Re: Auto-install (was autoloaded...)

2001-02-13 Thread Andy Dougherty
On Tue, 13 Feb 2001, Branden wrote: > Hello. > > I'm working on the PDD for par. I would like to propose a standard directory > structure for the files inside the archive, but I realise this depends > greatly upon the directory structure of Perl itself. > > How does Perl 5 manage its directory

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-13 Thread Nicholas Clark
On Tue, Feb 13, 2001 at 12:40:45PM -0500, Dan Sugalski wrote: > At 05:55 PM 2/12/2001 -0500, James Mastros wrote: > >It's pretty hard (for me) to think of when you'd want an AUTOLOADed DESTROY, > >since if you create /any/ objects of the class, DESTROY will be called. > >"It isn't possible to AUT

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-13 Thread Dan Sugalski
At 05:55 PM 2/12/2001 -0500, James Mastros wrote: >On Mon, Feb 12, 2001 at 05:33:05PM -0500, Dan Sugalski wrote: > >package foo; > >use attrs qw(cleanup_sub); > > > > would be nice, but I don't know that he'll go for it. (Though it's the > only > > way I can think of to avoid AUTOLOAD bei

Re: Auto-install (was autoloaded...)

2001-02-13 Thread Branden
Hello. I'm working on the PDD for par. I would like to propose a standard directory structure for the files inside the archive, but I realise this depends greatly upon the directory structure of Perl itself. How does Perl 5 manage its directory structure? Suppose $PERL is the base directory whe

Re: End-of-scope actions: Background.

2001-02-13 Thread Jarkko Hietaniemi
> Related > > Jarkko would really like > > print "Foo\n"; > > in a void context to behave as > > print "Foo\n" or die $!; Not just basic I/O but anything 'system': pipe(), system(), opendir(), mkdir(), chdir(), fork(), socket(), and so on. > I think that it would be nice in 5.8 to (optio

Re: End-of-scope actions: Background.

2001-02-13 Thread Nicholas Clark
I fear I'm not adding anything apart from noise to this debate. (partly from not having thought through the issues completely, partly by not reading the full archives for the list from last year) On Mon, Feb 12, 2001 at 01:58:35PM -0700, Tony Olekshy wrote: > unwind-protect a reality. As a resu

Re: End-of-scope actions: Background.

2001-02-13 Thread Tony Olekshy
Branden wrote: > > There's something I didn't quite understand about RFC 88: > > When I > > try { > die "foo"; > } catch { > die "bar"; > } > > I die with "bar", right? But what happens if I > > try { > die "foo"; > } finally { > die "bar";

Re: Auto-install (was autoloaded...)

2001-02-13 Thread Clayton Scott
Branden wrote: > And I'll probably ask you to use another naming/extension, like pp5 (par for > perl 5), so that modules for both versions don't get mixed up (since they'll > be incompatible). That doesn't make sense. Either your script or your archive tool (par, pun, or CPAN or whatever

Re: End-of-scope actions: Background.

2001-02-13 Thread Branden
There's something I didn't quite understand about RFC 88: When I try { die "foo"; } catch { die "bar"; } I die with "bar", right? But what happens if I try { die "foo"; } finally { die "bar"; } I die with "foo" or "bar" ? Why is this the