commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [digester][PROPOSAL] named stacks
Date Mon, 01 Mar 2004 22:51:56 GMT
On 28 Feb 2004, at 20:06, Martin Cooper wrote:

> I can't think of a specific use case for named stacks, but I'm 
> prepared to
> believe that one exists. I certainly appreciate the need for 
> communicating
> between rules, since that's something I've needed before, and I guess I
> could use named stacks for that, once it's in place.
>
> A couple of specific comments:
>
> * I don't see a need to auto-create the stack on get-style operations
> (e.g. pop and peek). I would think it would be sufficient to create it
> only when something is being pushed on to it.

yep

> * Wouldn't you want to throw an exception if someone tries to pop a 
> value
> off an empty or non-existent stack? You didn't specify the behaviour
> below, but I'm assuming that you're currently planning on returning 
> null
> in those circumstances?

this is a bit of a moot point, i'd say. i'd prefer to return null but 
the current behaviour (for the existing stack) is (i think) throwing a 
exception. my feeling is that the exception is really being used for 
control flow which (i'd say) is a bit wrong.

any particular reason why you'd want an exception to be thrown? (i'd be 
willing to persuaded that an exception is better.)

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message