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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to