Exceptions

2003-09-23 Thread Nigel Rantor
Hi all,

Quick poll regarding modules to provide more OO exception facilities.

Whenever I have mucked about with this I have opted to use Graham's 
Error.pm module.

I have found that it cannot handle a return within a catch block though, 
I haven't spent a lot of time exploring this yet but it is giving a 
couple of other developers some problems at the moment and making the 
code less clean than we would like.

I'm really looking for two things.

1) If anyone has any ideas about Error.pm or has found a workaround that 
would be great. I may go and have a look at the code myself if I get 
some time but if anyone has done this already I would love to hear from you.

2) Suggestions as to which exception mechanism module you would suggest 
using other than Error.pm, prefereably with reasons.

Cheers,

  N





Re: Exceptions

2003-09-23 Thread Graham Barr
Sorry if you see duplicates of this, I sent it originally from a 
non-subscribed address

On 23 Sep 2003, at 17:41, Nigel Rantor wrote:
Hi all,

Quick poll regarding modules to provide more OO exception facilities.

Whenever I have mucked about with this I have opted to use Graham's 
Error.pm module.
I may have wrote it initially, but it is now maintained by someone else.

I have found that it cannot handle a return within a catch block 
though, I haven't spent a lot of time exploring this yet but it is 
giving a couple of other developers some problems at the moment and 
making the code less clean than we would like.
This is because of the way it uses anonymous subs

I'm really looking for two things.

1) If anyone has any ideas about Error.pm or has found a workaround 
that would be great. I may go and have a look at the code myself if I 
get some time but if anyone has done this already I would love to hear 
from you.
At one time I was going to re-write it as a source filter. Using 
anonymous subs has all sorts of unwanted side effects, one being memory 
leaks in earlier versions of perl.

Graham.

2) Suggestions as to which exception mechanism module you would 
suggest using other than Error.pm, prefereably with reasons.

Cheers,

  N







Re: Exceptions

2003-09-25 Thread Nigel Rantor
Graham Barr wrote:
[snip]
Whenever I have mucked about with this I have opted to use Graham's 
Error.pm module.
I may have wrote it initially, but it is now maintained by someone else.
Well, I will always think of it as your's honey. :-)

I'm really looking for two things.

1) If anyone has any ideas about Error.pm or has found a workaround 
that would be great. I may go and have a look at the code myself if I 
get some time but if anyone has done this already I would love to hear 
from you.
At one time I was going to re-write it as a source filter. Using 
anonymous subs has all sorts of unwanted side effects, one being memory 
leaks in earlier versions of perl.
Hmm...I have never looked into source filters before. How hard do you 
reckon it would be then, eh?

If you already have a bunch of ideas about it then let me know, I might 
spend the time on it if the current maintainer wants to accept patches.

Cheers,

  Nige




Re: Exceptions

2003-09-25 Thread Shevek
On Thu, 25 Sep 2003, Nigel Rantor wrote:

> Graham Barr wrote:
> > At one time I was going to re-write it as a source filter. Using 
> > anonymous subs has all sorts of unwanted side effects, one being memory 
> > leaks in earlier versions of perl.
> 
> Hmm...I have never looked into source filters before. How hard do you 
> reckon it would be then, eh?

Writing a source filter is like trying to modify the parse tree, but 
without a parse tree. I much prefer techniques that allow you to hook new 
nodetypes into the parse tree from the source language, and Perl pretty 
much has this anyway with exporting symbols into the callee namespace.

S.

-- 
Shevekhttp://www.anarres.org/
I am the Borg. http://www.gothnicity.org/