1. stack.e changes

Chris,

I tried to email you but I must not have a correct email address for you. But
some of the unit tests for stack are now failing after the latest commit. Before
committing, can you please

cd tests 
exwc all.ex

and make sure the tests still pass? the dup() and pop() for FIFO fail now.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » topic index » view message » categorize

2. Re: stack.e changes

Jeremy Cowgar wrote:
> 
> Chris,
> 
> I tried to email you but I must not have a correct email address for you. But
> some of the unit tests for stack are now failing after the latest commit.
> Before
> committing, can you please 
> 
> cd tests 
> exwc all.ex
> 
> and make sure the tests still pass? the dup() and pop() for FIFO fail now.
> 
> --
> Jeremy Cowgar
> <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a>

Use oedoc hat free doubt fr as email, but I don't look at it in real time.

Problem is that dup() is not documented. 
I assumed that dup() means: push the value pushed last. And in that case, the
stack should be {30,30,20,10}, not {30,20,10,10}.
If it was meant to duplicate the top of stack rather, then the test is right and
my change is not. The pop() test fails because of the discrepancy for dup().

CChris

new topic     » goto parent     » topic index » view message » categorize

3. Re: stack.e changes

CChris wrote:
> 
> 
> Problem is that dup() is not documented. 
> I assumed that dup() means: push the value pushed last. And in that case, the
> stack should be {30,30,20,10}, not {30,20,10,10}.
> If it was meant to duplicate the top of stack rather, then the test is right
> and my change is not. The pop() test fails because of the discrepancy for
> dup().
> 

dup() should duplicate top(). dup() could be as simple as:

dup() = push(top()) I would keep the length() check in dup() so a meaningful
error message can result in it's misuse.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu