Closed ghost closed 1 year ago
Hey thanks for pointing this out, it's definitely confusing…
It's because xs = xs.plusAll(ys)
is equivalent to:
for (E y : ys) xs = xs.plus(y);
…so popping things off one stack and pushing them onto another ends up reversing them.
I'm not sure what the best solution is …changing the behavior at this point might break some people's code in hard-to-detect ways (though of course we would do a major version bump). Potentially could deprecate PStack.plusAll
in favor of some less confusing / better-named alternative methods.