New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PStack is not a stack #7
Comments
From hrld...@gmail.com on 2010-03-29T11:38:18Z I think you're right that the spec of PStack should make the stack-like constraints clearer. PConsStack, however, is definitely a stack in terms of its structure: plus(e) is an O(1) push, minus(0) is an O(1) I don't want to have methods actually named push(e) and pop() because those are traditionally mutators, and Basically the current design is that PSequence specifies any ordered PCollection, PVector is a PSequence with Thoughts? |
From ddoc...@samplesurgeon.com on 2010-03-29T14:53:57Z push, pop and peek are traditionally mutators, yes. Even though you're making an For an immutable stack, this is the interface I would expect... just these methods, interface Stack { In general, I think you're trying to generalise your base immutable structure too Your implementations are good, now you need to step back and consider what makes Have a look at this guy's implementation of an immutable stack... I think it's a nice |
From ddoc...@samplesurgeon.com on 2010-03-29T14:55:52Z Sorry, that should be: interface Stack { |
From hrld...@gmail.com on 2010-04-01T22:12:48Z I'm up for some sort of refactoring (in about a week I should have some time), but I'm not going to use You may have a point about bashing some sort of structure into too many forms, e.g. perhaps PStack being a I think you might be mistaken about implementation matters though. For one thing the only subclassing in Oh and also as far as implementation goes, note that ConsPStack's implementation is exactly like in the link So at the very least you should not be worried about the implementation; it really is a stack. Thanks for your input, hope I don't sound too defensive! :P |
From hrld...@gmail.com on 2010-04-01T22:27:55Z [Looking through the code I did notice that I did a pretty lazy implementation of ConsPStack.minus(int) -- it |
From hrld...@gmail.com on 2010-05-09T18:51:53Z Status: WontFix |
From ddoc...@samplesurgeon.com on 2010-03-29T14:26:41Z
Stacks should support the operations: push, pop, peek.
Original issue: http://code.google.com/p/pcollections/issues/detail?id=7
The text was updated successfully, but these errors were encountered: